How to retrieve multi row variable set data in form of record pills in flow designer.

PriyanshuVerma1
Tera Expert

Hey everyone,

 

I recently made a catalog item to add /remove multiple users from assignment group. Below is the image of that flow

In this i am checking what role the groups has based on that i am sending out approvals and then based on approvals adding users to the assignment group.

PriyanshuVerma1_1-1710757716785.png

The requirement now is to add multiple users to multiple groups. I believe i can use multi row variable set in catalog item.

We can use for each action and look up record to iterate through multi row variable set(array.object) and pull out information about user and group given as input.

I want to add ask for approval action and send approval, but using for each action if there are 5 users getting added to single group, then it will send approval to group manager 5 times.

PriyanshuVerma1_2-1710758364654.png

 

I want to send one approval per group, no matter how many members are getting added to it like I was able to do in screenshot 1 when I was adding multiple users to single group. 

Is there a way I can get values from Multi row variable set values in flow designer and use them like data pills?

Or get unique group values in an array, that i can iterate through to send approvals to group managers.

By unique group value i mean : if we enter 5 user and out of these two users are getting added to same group, then in array we should have 4 group names in our new array.

PriyanshuVerma1_0-1710765907290.png

 

Or there is any better approach i can follow to achieve the same goal.

 

5 REPLIES 5

Amit Verma
Kilo Patron
Kilo Patron

Hi @PriyanshuVerma1 

 

Below posts could be helpful :

https://www.servicenow.com/community/workflow-automation-articles/how-to-use-multirow-variable-sets-...

https://www.servicenow.com/community/now-platform-forum/how-do-i-iterate-through-a-multi-row-variabl...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Thankyou, but they are doing the same thing I already did. As I mentioned if I use FOR EACH action, then i might need to send approval multiple times. I was trying to get unique group (like if there are two different users getting added to same group then only one time group value is pushed in array) from multi row variable. set values in some array So that I can use the new array to send approvalonly once per group

I understand what you are trying to do, but do you really think it's the best approach? I select 5 different users to be added to 3 groups (so 15 lines) and as approver I can only say 'ok' for all, because that's the only approval record I get. I don't want one of them in the group, so none of them get in there? I believe every entry should be approved separately. And yes, that cause multiple approval records/emails to be send, but that's how it should be, right? 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hey @Mark Manders , 

Thankyou for replying to me. I believe what you are saying is correct but see there is another problem as well. I am attaching the screenshot of the flow i used earlier. I am trying to achieve something similar.

Screenshot 2024-03-19 151111.png

The approach that you are advising me to follow have a little flaw. Assume 5 users are there and 3 of them are getting added to same group, then 3 approvals will be sent to group manager using "For Each" action. Now I can add one if condition after each approval to check if it is approved and then use create record to add users in group.

Then what will happen is after each approval manager will get new approval if there are more than  1 member. 

What my manager wants is not to bombard group managers with approval emails one by one as they go on approving. 

That's why I was hoping to send one approval to group managers, so that they can see the RITM and see who all users are getting added to their group