Need to trigger approvals in workflow based on selected values in list collector.

sadhana ghuge
Tera Contributor

I have a requirement where I need to trigger approvals based on the values selected in list collector variable on catalog item. I have a list collector variable(selected_country) on catalog item refers to the country table( which contains all other countries and one option as GLOBAL also).  

Then I have one table approval_users where we have two column (approver_name & country),  for each country there in only one dedicated approver (for example if I have 100 countries in country table then there are 100 approvers in approval_users table). For Global also there is one approver.

 

In workflow I have 1st level of approval to group A. Once it is approved I need to trigger next level of approvals depend on List collector (selected_country) variable selection as below:

 

Case 1: if list collector (selected_country) has 5 countries selected and it does not contain "GLOBAL" ---> Then I need to trigger approvals to all the 5 approvers in approval_users table.

for example: one of the country in list collector is INDIA then approval should be triggered to that one approver from INDIA in approval_users table.

 

Case 2: if list collector (selected_country) has selected value as "GLOBAL" only one value and it does not contain any other countries ---> Then I need to trigger approval to that one approver is there for global in approval_users table.

 

Case 3: if list collector (selected_country) has 6 countries selected and also it contains value "GLOBAL" as well  ---> Then I need to trigger two levels of approvals here - first approval to all other 5 country's approvers in approval_users table and 2nd approval it should go to GLOBAL approver.

for exmaple: If 3 options are selected in list collector as Global, India and Algeria then 1st level of approval should be triggered approvers in india and algeria and then 2nd level of approval will go to approver in Global.

 

I need assistance to configure this requirement using workflow. 

 

Thanks in Advance.

 

4 REPLIES 4

Vikasgc
Tera Contributor

Can you please post the snap of form fileds

If it consists 6 countries with global also you use for each loop in the backend flow and use if and else if

it's not consisted of just 6 countries, it's a list collector variable which has reference to country table where more than 200 countries are present in table.

user can select multiple countries at a time. need trigger approval for each country.

Numbers not a matter

For each loop works accordingly 

Jugmaz
Kilo Sage

I would probably go with subflow/s

each for every situation - if they need to be chained then even easier

so - your list collector is for qualification as well
if global selected - run this subflow

if n-countries selected - run this subflow

Subflow/s then utilizes the list of country/approver to create approval record etc.

Would that be sufficient?