cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AAallday
Helper I
Helper I

Run Flow Based on Other Items

Hi All,

 

I have a SP list that tracks site inspections. I added a flow, then whenever a site visit is modified, with a condition of the "Status" = Completed, to create a new list item with a inspection due date for next year (in the month the current year inspection was completed).

YearFacilityAreaDue DateComplete DateStatusRevisit Needed?
2020ABC15/31/2020 PendingNo 
2020DEF26/30/20207/12/2020CompletedYes
2020GHI38/31/20208/15/2020CompletedNo
2021DEF27/31/2021 PendingNo 
2021GHI38/31/2021 Pending No

 

A part of the process if the inspector sees an issue is to mark for a "revisit". However, when they complete the revisit and change the Yes to No it triggers the flow again (because the item was modified and the status is completed).

 

I am looking for ways to run the flow only IF the next year item has not been created.  So in the case above, when the inspector changes the "yes" for DEF to "no", the flow would not meet the condition because to 2021 item for DEF is already created.

 

I have tried a few things, but not an expert so nothing seems to work.

 

I have tried a "Get Items" and tried counting the number of rows returned but not sure it's the right way to do it. 

 

Appreciate the help!!

1 ACCEPTED SOLUTION

Accepted Solutions

@AAallday 

 

i would suggest you to create one more column(Next Year) for-item created for the next year as Yes/No and keep default value as No. Then use condition- Status is equal to Completed AND Next Year  is equal to true. After item created for next year use update action and set Next Year column as false so that if you make any changes it will not affect your next year item list.

 

Thanks

Hardesh

View solution in original post

5 REPLIES 5
Hardesh15
Super User II
Super User II

@AAallday 

If i correctly understood your problem. You want to create item in another list based on status completed whether revisit is yes or no. If flow run first time with status completed then it will create item in another list. Later no matter revisit is changing yes or no you only want flow check if item is previously created then it will avoid creating duplicate entries.

 

Am i correct ?

 

Thanks

Hardesh

@Hardesh15 

That's exactly right

when an item or file is modified

- if the status = completed AND

- if the same facility does not have an item created for the next year

- then create a new item for the facility (for the next year)

 

 

@AAallday 

 

i would suggest you to create one more column(Next Year) for-item created for the next year as Yes/No and keep default value as No. Then use condition- Status is equal to Completed AND Next Year  is equal to true. After item created for next year use update action and set Next Year column as false so that if you make any changes it will not affect your next year item list.

 

Thanks

Hardesh

View solution in original post

Awesome -- thank you! This seems to work. Looks like the update step triggers a new flow (because the item was modified), but does not meet the condition so no looping

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (907)