Checking the status field of all items in a sharepoint list

Brass Contributor

I have a sharepoint list that is maintained throughout the day by each of our bank branches.  Each branch has their own item in the list.  When they are done for the day, they change their status to "verified".  I want to build a flow that will check the status of all items in the list and send an email when they are all in the "verified" status.  As of now, it sends an email when each status is changed to verified, but only want 1 email for all.  Any ideas out there?

 

Thanks

17 Replies

@rbutgins21 

My understanding of your desired solution:
Each branch has their own item in a list (bank branch list) and every morning, the status is supposed to be "unverified". So that when they are finished, they update their status to verified. When every status is verified, an notification should be sent to inform that everyone is finished. When that has happen, the status of every item should go back to be unverified (to be set for the next day).

Suggestion for solution:
Have two lists, one for the bank branch, and another one for Power Automate counter (one object in the list with number column). Whenever an item is updated in the bank branch and the field has gone from unverified to verified, update the other object in the Power Automate counter list with +1.
When the number reaches the same amount as all of the branches, then trigger an notification. After the notification has occured, either have a button triggered reset for the verified/unverified status, or make it automatic.

I hope this makes sence, if anything is unclear, please tell and I will try to explain further.

That could work. But I would use a get list items on a scheduled run every 5,10,15 minutes or so. Whatever is acceptable.

Then get items action on the list.

Next out a condition and out the get items status field in the check and this will add an apply to each loop. For the condition put in = verified.

For the no branch when false out an end workflow (might be terminate) action.

This will make it not continue if all the items aren’t true. After the loop then do what you want when all items are verified. You can then also do another update item and use the get items status column update in it and it will loop through each item and you can reset it automatically And also plug your email action before or after this loop through the items. If you don’t want to reset then obviously skip this step.

Anyway the other suggested option will work too but this way you can do without an additional list but a little more complicated.

Hope it helps ;).

@ArefHalmstrand  What is the syntax for adding 1 to a number field in Power Automate? 

rbutgins21_0-1601315098546.png

 

Try this: add(triggerBody()?['number'],1)

@ArefHalmstrand  Having issues with my condition statement - can't get it to be true - the status has been changed to verified, but that step keeps failing.  I am missing something simple as this is not a complicated flow....

rbutgins21_0-1601322191607.png

 

I will try build similar scenario and test it :)

Is your "verified" field a choice field or free text ?

@rbutgins21  I rebuilt the flow, but changed the status to status value and then had it send an email when it was true - that worked.  Now, when I delete the email step and do an update item, it is telling me "could not find the list item"

 

rbutgins21_0-1601323472793.png

 

Great! Strange error, try looking further on what has happen (perhaps a condition has been changed). You could also try to reconnect the SharePoint list connection.

@ArefHalmstrand  The condition step seems to be working, but now it is failing when I'm trying to update the 2nd list that contains the count. 

rbutgins21_0-1601324394144.pngrbutgins21_1-1601324466072.png

 

Could there be an issue with the actual list? It is hard for me to give any solid advice.

@ArefHalmstrandI guess I should ask the question - is it possible to have a trigger where an item is created or modified from one list and check the status on that list and if it meets the criteria - process an update item for another list.  I'm basically trying to count the number of branches on the trigger list, that have been changed to verified, by updating the count on a separate list.  The update step is where it is failing  - it's telling me that the list item is not found.

@rbutgins21 That should really not be an issue, updating a second list based on a trigger on the first list is common. However the connection has to be configured. I will try to find time to create a similar solution to try it out and see if I can recreate the same error that you are receiving. 

@ArefHalmstrand  I'm thinking it has something to do with the *ID (unique identifier of item to be updated).  I was just choosing ID, but I don't think that uniquely identifies the item in the list. 

rbutgins21_0-1601388320090.png

 

Try to manually add the ID of the listitem (the ID can be shown if you edit the current view in the list).
If it is the first item in a list, the ID should be 0

@ArefHalmstrandIt's the first and only item in the list, but I am still getting the following error...

 

rbutgins21_0-1601392498397.png