youlearn
Canvas Initiate

Site workflow based on a item value

Hello 

I have a site workflow which sends an approval email and when approved it loops through a list and runs a list workflow which marks column Approved to Yes. I followed steps here and added and Flexi Task on the top of the workflow

I want to run this site workflow on a schedule. 

My issue is when the site workflow is triggered it should verify if any of the items Approved column value is No and then only it should trigger Flexi Task approval email. 

Help please . 

Thank you

@R

0 Kudos
Reply
3 Replies
kunalpatel
Automation Master
Automation Master

Re: Site workflow based on a item value

@youlearn ....query your list and apply filter where Approved = No, get the IDs and store them in a collection variable, using For Loop, ID collection variable, perform your logic.

0 Kudos
Reply
youlearn
Canvas Initiate

Re: Site workflow based on a item value

Hello Kunalpatel, 

I have figured that part but facing other issue. 

In my list workflow I have a column State and Approver (email address). 

In my site workflow I am able to filter based on Approved status is no but I am left with multiple items with different States and email address. 

I am able to use collection operation filter these emails, check for duplicates. 

I want to send Flexi Task to each of these emails based on the State and when approved I will run the list workflow and mark approved as Yes. 

The challenge here is to run the Flexi Task in a loop and trigger List workflow which should mark Approved column as yes . And Flexi task should be assigned in such a way that item with State TX should only approve TX item. 

 

0 Kudos
Reply
kunalpatel
Automation Master
Automation Master

Re: Site workflow based on a item value

@youlearn ...as mentioned earlier you need to use ID collection and not approvers collection. Try below steps:

 

  1. Query your list BUT filter it where Approved column value has "No"
  2. Get IDs, Approvers, State and store them in respective collection variable i.e. collec_IDs, collec_Approvers, collec_StatesFromList
  3. Create a number variable called it "num_Index"
  4. Also create the collection variable i.e. collec_States and store all your states while creating the collection (this is to dynamically run your workflow)
  5. Now using For Loop and collec_States, store it in slt_eachState
    1. Add another For Loop and use collec_IDs and store it in int_eachID and add num_Index to get the indexing of that ID
      1. Add collection operations --> Use collec_Approvers --> use num_Index and store it in slt_eachApprover
      2. Add another collection operations --> Use collec_StatesFromList --> use num_Index and store it in slt_eachStateFromList
      3. Add Run IF action and condition will be slt_eachState = slt_eachStateFromList
        1. In here you use add actions you need to perform

Also, just out of curiosity...why can't you run the workflow on list item which will assign task to your approvers? And if approvers approves the task then using update item changed the status as Approved or Approved as Yes.

0 Kudos
Reply