cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted

@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
Highlighted
Super User
Super User

@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

Highlighted

@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)

 

 

Highlighted

@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

Highlighted

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

Highlighted

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (9,735)