In this post I’m going to give 7 golden rules of Flow development. Within Power Automate it is all too easy to develop Flows and forget about some standards that you might want to follow.
Name your actions
Naming your actions can be very important if you want your flows to be understandable by someone else.
In the above example you will not be able to guess what this flow is doing. Simply because the the actions weren’t named correctly
Rename your actions but keep the types
The other thing which is important is that you keep the original action name. In the example of variables it might be useful to know which actions are initializing variables and which ones are setting variables.
For Variables this might not be that important but if you now consider the the actions in a SharePoint connector and you can use different actions to do the same thing then it might help you. As an example flows can use a Sent a HTTP request to SharePoint or a Update Item action to update your SharePoint list items. If you want to make your Flows more generic then it might help if you can identify the less generic actions quickly
Use error handling in all your flows
I’ve written many posts about the Try Catch Finally pattern. For the details please have a look at my Try Catch Finally pattern post.
Avoid nested loops
Many times I see people use nested loops in Flow. They can be difficult to avoid, however they are very slow. Shown below,a flow that collects tasks and then collects details of the people assigned a task.
Rather than the above it would be better to create two Apply to each tasks where one feeds the other.
One way to do this can be by using the Compose action in an Apply to each as described in the Compose actions inside apply to each steps post
Avoid variables (in branches)
When you use parallel branches and you use variables then branches will wait for each other. This of course doesn’t help the performance. If possible try to use compose actions instead to hold information
It is very easy to use update actions to update SharePoint list items, however during design time Power Automate will need to know the field details of your list. This means that you can’t soft code the site url and list name.
Using the Send an HTTP request to SharePoint action is easier as the update details is all made up by text/json. For more details see SharePoint REST API for low code developers
Sometimes it can help to add comments to actions. It does take a lot longer to develop your flows therefor you could leave it to the minimum. It is however important to leave the comments when actions need further explanations