Remove option from List Collector when not approved in flow designer

Brian DeBlis
Tera Expert

Hi all,

Kind of stuck and need a way forward. We have a list collector on a catalog item that you can choose multiple roles. Those roles go to teams for approval. I take the list collector and convert to an array and loop through to send the approvals. But, when one of those approvals is rejected, I need to remove it from the list collector before the task is sent to the fulfilling team to add roles. How do you accomplish that in flow designer? 

4 REPLIES 4

YaswanthKurre
Giga Guru

Hi @Brian DeBlis ,

 

  1. For each role, send an approval to the appropriate team.

  2. Store approved roles in a  temporary value. (Flow variable)

  3. After the loop, you'll have an array of only approved roles.

  4. Use a Script step to update the list collector variable with only the approved roles., this will override initially submitted roles, might be a problem if you want to see what was initially submitted.

var approvedRoles = ['role1', 'role2']; // Replace with your approved roles array
current.variables.role_list_collector = approvedRoles.join(',');
current.update();
//This script updates the catalog item variable (role_list_collector) with only the approved roles before the task is sent to the fulfillment team.

 

or you can use the approved roles from temporary flow variable and copy to task description.

 

Please mark this as helpful or correct if this solves your issue.

Thanks,

Yaswanth.

 

Hi @YaswanthKurre ,

That is a good idea. Not all roles require additional approval, how would I keep those roles in there, as well? Just populate them in approved roles initially?

 

Hi @Brian DeBlis ,

 

Create a temporary flow variable and call this from flow logic in the for loop after the approval step. 

The flow variable needs to be concatenated with every approved role.

 

Thanks,

Yaswanth

Muhammad Salar
Giga Sage

Hello, 
Add rejected roles in array flow variable if approval is rejected Or Add approved roles in array flow variable if approval is approved
Then, you can use script in custom action to update the variable value.