- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 08:21 AM
I have a Catalog Item with a Multi-Row Variable Set (MRVS). I need to iterate through all the records in the MRVS, and create an Approval for each Owner (one of the fields in the MRVS).
I was able to start this, and make sure that the loop is working correctly. Currently, I have it loop through all the records, and have it log the Owner field value. That is working perfectly, so I know my loop is good. Here is what it looks like:
Here is the caveat/tricky part: Many times, the Owner will be repeated. I only want one record to be created per Owner.
For example, if I have 4 records in my MRVS, and the Owner for each record looks like this:
Record | Owner |
1 | Adam Allison |
2 | Barb Berry |
3 | Chris Curtis |
4 | Barb Berry |
I only want to create 3 approvals, not 4 (Barb Berry will get just one approval, not two).
How can I do this in my Subflow?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 04:49 PM
Hm, thinking about it, if you need only an approval, you can simply go with the following solution:
A simple "All users approve" is sufficient. It will create an individual approval for each "owner" and go to the next step only when all users approved.
Would this work for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 09:49 AM
The easiest way to get the "unique" users is to do a simple "Look up records" Action. However you need to convert the MRVS into a single line, you can do this by adding a new flow variable called "Owners" of type "string".
You need to iterate over the MRVS and concatenate the approval users.
Please check out the screenshot below, and note step 3.
In step 5 you iterate over the now unique sys_user records. To do the approval concurrently, you would need to create a new subflow which only contains the approval (and probably a syncronization variable so you know at some point that all approvals have happened). This subflow can be called with "Wait for Completion = false" so they run in parallel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 10:22 AM
OK, that is helpful in getting me started, I think. But you lost me on the last part regarding the approvals. I set as you have shown, and that last step is not running:
Here is what that last step looks like:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 11:44 AM
Please click on each step which is related to the flow variable and check, if the variable is being properly populated.
Probably the easiest thing is to expand every step by clicking on it once and posting back the screenshot of the fully expanded flow execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 11:52 AM
OK, here it is:
Does that help?