cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
victory1234
Level: Powered On

Can you do this in Flow? - Lookup list question

I have two lists in sharepoint. One with titles and the other list is connected to it with sub-items for each title. List 2 has another column to mark weather it is completed or not. I want to automatically mark A, B, and C completed when the sub-items associated with them are all marked completed (example: check list 2 - if A -1, A-2, and A-3 are marked Y in the completed column, then mark A as Y in the completed column in List 1)

 

List 1                 List 2           

A                       A- 1

B                       A-2

C                       A-3

                         B -1 

                         B- 2

                         C-1

 

 

 

4 REPLIES 4
Super User
Super User

Re: Can you do this in Flow? - Lookup list question

@victory1234 

Is there a column in List 2 that is a lookup column and points back to list 1?  If not, how can you identify items in list 2 taht are realted to items in list 1?

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
victory1234
Level: Powered On

Re: Can you do this in Flow? - Lookup list question

Apologies, yes I do have them linked. They look more like this

 

lists.JPG

Super User
Super User

Re: Can you do this in Flow? - Lookup list question

@victory1234 

I will provide a solution in a few hours - it invloves more steps than you would think......

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
jwhite
Level 8

Re: Can you do this in Flow? - Lookup list question

Hi @victory1234 ,

I'm sure there are multiple ways to do it but here is my humble suggestion:

I set up two lists similar to how I think you have them:

SCLists.png

I set up a flow with the trigger of "When an item is created or modified" looking at the list with the subtasks in it (Test list 2 in my case) and also set up a variable that will keep track of whether or not all tasks have been complete. We set the initial value for our variable as true, as we will change it to false later in the flow if needed:

SCTrigger.png

 

I then used the Get items task on my main list, filtering it so it only returns items which have the same title (A,B,C,etc...) and also aren't already complete. If they're already complete we don't need to worry about them!

SCGet.png

 

I then use an Apply to each, using the value from our Get items from main list, to get the items from our subtask list which have the same title.

SCGet2.png

I then have another apply to each that goes through each item we just got from our sublist and checks whether its status is "Y". If any of them don't have a "Y" in status, we then set our tracking variable to false:

SCCheckStat.png

Finally, just outside of our Apply to each for the subtasks and inside the apply to each for our main tasks we then have a condition which checks if our variable is still true, if so we update our main task item to have Y in the status column:

SCUpdate.png

 

All my tests came back working like you described you wanted, so let me know if it helps! If not I will see what else may be lurking going wrong.

You could certainly do without putting all the flow in the Apply to each for the main task list, but I decided to do this just to try and keep run times down if you end up getting a very large list as the first filtering will just cause the flow to complete if nothing meets the criteria.

Full flow in spoiler:

Spoiler
SCFullFlow.png

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 135 members 4,586 guests
Please welcome our newest community members: