Workflow Approval User Dynamically Based on Cat Item Variable Reference Field

Stephen Skaggs
Kilo Sage

I am trying to create a dynamic workflow approval based on a reference variable. For example, I have a point where a manager of a cost center is required for approval when the cost center variable is selected on the catalog item. For more details into what I mean, I will provide a better example.

Catalog Item Request --> Variable Cost Center A Selected from reference field --> Approval - Manager of Cost Center (dynamically based on the cost center that was selected).

If you need more info let me know.

 

 

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

You have to use Approval User activity in workflow. There you have to write below code in Script section. See below

find_real_file.png

 

I have mentioned script as well in Script box above.

Thanks,
Ashutosh

View solution in original post

7 REPLIES 7

Have you replace YourRequiredFields in script with actual field name?

 

This will be the field name of manager on cost center form. Make sure Cost center has Manager field and value in it.


Thanks,
Ashutosh Munot

This is what I am currently putting in there and the cost center manager value is there. But keeps skipping that approval.

 

answer = [];
answer.push(current.variables.cost_center.cmn_cost_center.manager.toString());

 

ok I got it to work

instead of using:

answer = [];
answer.push(current.variables.cost_center.cmn_cost_center.manager.toString());

 

I used:

answer = [];
answer.push(current.variables.cost_center.manager.toString());

 

I needed to remove the table since the reference field is already calling on that table.

 

Thanks for yall's help!