run script to extract value of a mrvs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 11:32 PM
Hello,
this is for a catalogue item that has MRVS. we are processing approvals through a workflow and we are using a switch condition to extract the MRVS values.
based on the selection i the variable, the approvals should trigger. but it is not working and the state changes to finished.
The variable in the MRVS is a list collector and we are fetching it from the table: core_country.
can you please help me create this run script? we are basically fetching all the country from this table and users are adding it to the mrvs variable. users can add multiple country and we want approvals to generate based on country selected.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 07:40 AM
Post your script attempt using the insert code icon (</>) and we'll get you sorted. I assume not shown in the screenshot is an else condition that the workflow is always taking to get to the finished state? You are extracting multiple values, so maybe Switch isn't the correct activity? If you successfully extract China, Netherlands, and Indonesia, you want three group approvals, right? It seems like, given your example, a better approach is to use one Approval - group activity that has the script to extract the country values from core_country based on the values in each row of the MRVS in the list collector. So you'll have a list of all of the country names that were selected in all rows of the MRVS, then a series of if statements to add a specific group to the answer array if a certain country is present in this list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 11:34 PM
Hi Brad, can you please help me with the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2024 06:34 AM
Sure. Do you want to try the Approval-group activity script approach to add a group for each country from the MRVS?