
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2019 02:41 PM
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.
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 06:35 AM
HI,
You have to use Approval User activity in workflow. There you have to write below code in Script section. See below
I have mentioned script as well in Script box above.
Thanks,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 07:48 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 08:33 AM
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());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 09:17 AM
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!