I need to pass dynamic and static both the values in my flow.

pandeyved
Tera Contributor

In my organization, we build a functionality to pass json_input to flow which will update the RITM Field.

So we pass like this:
{
   "sys_db_object": "sc_req_item",
   "assignment_group": "2830c02fdbd64150574073e3f39619b1",
   "u_service_instance": "current.variables.choose_application_service"
}

So this will update the assignment group and application service on RITM.

But I wanted to print the dynamic and static both the values.
Like if we want to print short description where I will take some static data from RITM form and some dynamic data from variables values filled in Catalog.

Like This:
{
   "sys_db_object": "sc_req_item",
   "assignment_group": "2830c02fdbd64150574073e3f39619b1",
   "u_service_instance": "current.variables.choose_application_service",
   "short_description":"current.item.name, - ,current.variables.choose_permission.display_value"
}

 

Can you pls suggest some ways, how we can achieve this.

Thanks

3 REPLIES 3

SANDEEP28
Mega Sage

@pandeyved  You can write it as below, You can use variable name as is.

 

{
   "sys_db_object": "sc_req_item",
   "assignment_group": "2830c02fdbd64150574073e3f39619b1",
   "u_service_instance": current.variables.choose_application_service,
   "short_description": current.item.name + ' - ' +current.variables.choose_permission.display_value,
}

 

If above doesn't work then try below, adding toString() method to get output in string format

 

{
   "sys_db_object": "sc_req_item",
   "assignment_group": "2830c02fdbd64150574073e3f39619b1",
   "u_service_instance": current.variables.choose_application_service.toString(),
   "short_description": current.item.name.toString() + ' - ' +current.variables.choose_permission.display_value.toString(),
}

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

Hi @SANDEEP28 

I tried this, but it is returning undefined.

SANDEEP28
Mega Sage

@pandeyved Are you passing this json input from business rule ? Also try printing below variables to see whether it contains value or not before passing to flow 

current.variables.choose_application_service

current.variables.choose_permission.display_value

 

Have you tried .toString() also? Share some screenshots here

current.item.name