+ Start a Discussion

How to store collection Variable values to use in another loop

I have a requirement to get a list of Users from a particular Group, check for their Permission Set and send custom notification to these Users. Is this achievable through Lightning Flow. I am not able to store the list into a variable as we do in Apex. Any help is appreciated. 

you are able to store the selected values in a collection variable in a flow too. When you create a new variable, you can set the flag - 
Allow multiple values (collection). Later on you can use it for. e.g. in a loop.

If this helps, please mark as Best Answer to help others too.
Thanks but I have tried doing that. So basically I have to convert below code into my Flow
for(Case c: [SELECT Id, CreatedById FROM Case WHERE Id =: caseId]){
userId = c.CreatedById;
Id permSetId = [SELECT Id FROM PermissionSet WHERE Name ='XXXXX'].Id;
for(GroupMember grpMem : [SELECT Id, UserOrGroupId FROM GroupMember WHERE UserOrGroupId =: userId]){
for(GroupMember grpMem : [SELECT Id, UserOrGroupId FROM GroupMember WHERE GroupId =: lGrpid]){
for(PermissionSetAssignment p: [SELECT AssigneeId,Id,PermissionSetGroupId,PermissionSetId 
                                FROM PermissionSetAssignment
                            WHERE PermissionSetId =: permSetId
                            AND AssigneeId =: luserIds]){

I have to get a list of Users within that particular Group , with that Permission Set .