cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OllyL
New Member

Best Practise for SharePoint "On Item Changed / Created"

Hi There,

 

We're about to start developing a SharePoint app solution for a customer and we're hoping to leverage Power Automate as much as we can for the backend automation.

 

For some lists in particular we might need to chain off a number of different activities when items are updated and so I was wondering what the best practise is here when it comes to building flows.

 

Should we create a number of different flows all with the same trigger and split functionality across them, or is it better to keep to one giant flow which does it all? Also assuming we did spit the functionality across flows, is there any way of controlling run order (e.g. flow dependance) or would we need to assume that the flows could trigger in any order and be aware of race conditions?

 

Any advice anyone could offer would be much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Community Champion
Community Champion

HI @OllyL 

 

I have to give you the worse answer possible. "It depends." :).

 

Here are some things that you can considering while planning for your development, but overall I would always advise the following:

  • Keep your Flows as small as possible. Easier to maintain and easier to debug in case something happens.
  • Keep everyday tasks in sub-flows. For example, if you have multiple Flows that have to act on a document, isolate that action on another Flow and then use the "Run Child Flow" to achieve it. Again we keep the Flows small and manageable and minimize where we need to change things. 
  • One Flow does one thing. A good rule of thumb is that if you can't write what the Flow is for in one sentence, you need to break it down. For example, if you have a flow with five steps of approvals, develop 5 Flows that call each other once finished. I detail "Long-running Flows," but the main idea is to break things into small pieces.

So my opinion is to go short and fast. By separating and isolating things, you'll be able to better deal with maintenance, bugs, and more. 

 

Finally, regarding the race conditions, you can't define how the Flows are triggered or in what order, but you can control them by thinking about the triggers. For example, if you have multiple chances to perform when something happens, put that trigger on one Flow. Then use sub-Flows to deal with the different cases. The Flow will be small and delegates a lot of functionality to other Flows.

 

It's a super interesting question, but there's a lot here. I hope that more people chime in, but this is all about strategy and how you want to deal with things. Both approaches have tradeoffs, and all I mentioned is my personal opinion.

 

I hope it helps you!

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
Otherwise, reply to it, and the community will do its best to help you.

View solution in original post

2 REPLIES 2
manuelstgomes
Community Champion
Community Champion

HI @OllyL 

 

I have to give you the worse answer possible. "It depends." :).

 

Here are some things that you can considering while planning for your development, but overall I would always advise the following:

  • Keep your Flows as small as possible. Easier to maintain and easier to debug in case something happens.
  • Keep everyday tasks in sub-flows. For example, if you have multiple Flows that have to act on a document, isolate that action on another Flow and then use the "Run Child Flow" to achieve it. Again we keep the Flows small and manageable and minimize where we need to change things. 
  • One Flow does one thing. A good rule of thumb is that if you can't write what the Flow is for in one sentence, you need to break it down. For example, if you have a flow with five steps of approvals, develop 5 Flows that call each other once finished. I detail "Long-running Flows," but the main idea is to break things into small pieces.

So my opinion is to go short and fast. By separating and isolating things, you'll be able to better deal with maintenance, bugs, and more. 

 

Finally, regarding the race conditions, you can't define how the Flows are triggered or in what order, but you can control them by thinking about the triggers. For example, if you have multiple chances to perform when something happens, put that trigger on one Flow. Then use sub-Flows to deal with the different cases. The Flow will be small and delegates a lot of functionality to other Flows.

 

It's a super interesting question, but there's a lot here. I hope that more people chime in, but this is all about strategy and how you want to deal with things. Both approaches have tradeoffs, and all I mentioned is my personal opinion.

 

I hope it helps you!

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
Otherwise, reply to it, and the community will do its best to help you.

Thanks Manuel, I've not got tons of experience with Power Automate so I wasn't familiar with Run Child Flow / Sub Flows but that sounds like a very sensible way to approach it. I'll do some reading!

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,671)