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

What is best practice or the alterative to having to update the same list several times within a flow?

I have a flow where I update a status field within a list. Conditions follow suit and the need arises to update a field for the same list again according to the conditions outcome. Finally a Switch is reached where each of several results call for an update to the same aforementioned list once again, including a status field update.

 

Now that all works fine, but I wonder, is there a more eloquent way to having to use "update item" or is this the only practical way?

 

Thanks.

4 ACCEPTED SOLUTIONS

Accepted Solutions
takolota
Power Participant
Power Participant

I don’t think there’s anything you can do if different parts need different updates based on some criteria, unless you want to manually type the conditionals in a single Update action with multiple if() expressions.

 

However if your goal is to reduce the number of actions & API calls used and these are conditionals in a loop, Then I would definitely look into replacing any conditionals in a loop with Filter array actions before the loop.

View solution in original post

MikeRodgers
Helper I
Helper I

Hello takolota,

So if I may ask, then it is totally acceptable to have several update items especially when it calls for status field toggling in a flow, or in general for that matter?

 

Yes my goal was also to reduce the number of actions if possible and to be honest also not come across like a novice to other power users.

 

"definitely look into replacing any conditionals in a loop with Filter array actions before the loop."
That concept is new to me. Any chance of simple example of such you may be able to point me towards so that I may glean from it?

 

Thank you.

View solution in original post

So are you only updating the status column or are these separate conditionals & switches determining what should go in other columns beside status?

View solution in original post

takolota
Power Participant
Power Participant

Sure, as long as those Update items are updating different things depending on other actions and conditions that are different for each condition, then I don’t know of any way to reduce the number of Update items and no one would think you’re a novice for setting it up that way.

 

On the topic of reducing actions, often the immediately visible actions in a flow don’t matter that much as 90% of action API calls usually come from people doing things in an Apply to each loop where each loop runs a new set of the actions within it. So 100 runs of a loop with 5 actions in it equals 500 actions for that one flow run. Better managing things to reduce those actions tends to be where I see the difference between novices & pros where pros know how to use the Filter array and Select actions.

But as I said before if this is just the simple cloud flow you described then there’s only a few things you can do to make it more efficient like make sure it’s only triggering when it needs to with trigger conditions or making sure it’s only editing the records it needs to with Odata query filters. There just aren’t many things that would identify someone is a novice.

View solution in original post

7 REPLIES 7
takolota
Power Participant
Power Participant

I don’t think there’s anything you can do if different parts need different updates based on some criteria, unless you want to manually type the conditionals in a single Update action with multiple if() expressions.

 

However if your goal is to reduce the number of actions & API calls used and these are conditionals in a loop, Then I would definitely look into replacing any conditionals in a loop with Filter array actions before the loop.

MikeRodgers
Helper I
Helper I

Hello takolota,

So if I may ask, then it is totally acceptable to have several update items especially when it calls for status field toggling in a flow, or in general for that matter?

 

Yes my goal was also to reduce the number of actions if possible and to be honest also not come across like a novice to other power users.

 

"definitely look into replacing any conditionals in a loop with Filter array actions before the loop."
That concept is new to me. Any chance of simple example of such you may be able to point me towards so that I may glean from it?

 

Thank you.

So are you only updating the status column or are these separate conditionals & switches determining what should go in other columns beside status?

takolota
Power Participant
Power Participant

The Filter array action can mimic a conditional, and be much more efficient if you’re updating or creating things in an Apply to each loop.

 

But on the second reading it sounds like you may have a cloud flow only working on 1 column at a time, so that doesn’t apply here.

Thank you for your reply.

It is the latter of the two:
For example: At the beginning, I change the status to pending via Update Items , then later there is an approval sent.
The outcome is then run through a switch and for each ( according to the outcome ) an update item action will apply. Pertinent fields will be updated along with the status field.  To add, I cant recall but there is a conditional somewhere in between that requires an update item before it goes to approval. So in this instance there are 3 Update Items that are processed regardless of the Switch.
In this instance I would suppose that is as it is, yeah?

Thanks again.

takolota
Power Participant
Power Participant

Sure, as long as those Update items are updating different things depending on other actions and conditions that are different for each condition, then I don’t know of any way to reduce the number of Update items and no one would think you’re a novice for setting it up that way.

 

On the topic of reducing actions, often the immediately visible actions in a flow don’t matter that much as 90% of action API calls usually come from people doing things in an Apply to each loop where each loop runs a new set of the actions within it. So 100 runs of a loop with 5 actions in it equals 500 actions for that one flow run. Better managing things to reduce those actions tends to be where I see the difference between novices & pros where pros know how to use the Filter array and Select actions.

But as I said before if this is just the simple cloud flow you described then there’s only a few things you can do to make it more efficient like make sure it’s only triggering when it needs to with trigger conditions or making sure it’s only editing the records it needs to with Odata query filters. There just aren’t many things that would identify someone is a novice.

MikeRodgers
Helper I
Helper I

Thank you again takalota for your expertise and generosity.  Borderlining a sense of self-consciousness  🙂 by "not looking like a novice", I have reached beyond the point of  knowing the fundamentals and I am now seeking to become more efficient and filling in the gray areas. 
With gratitude, Mike.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,731)