Categories
Office 365 Power Automate Sharepoint Tips

Power Automate SharePoint Update Loop

“Actions in this flow may result in an infinite trigger loop” when updating the same list item on the “When an item is created or modified” trigger.

In this scenario, Power Automate will enter an infinite loop as the actions in the flow trigger a new instance of the flow. SharePoint Designer workflows internally prevented this scenario so this guide will explain how to achieve the same in Microsoft Power Automate.

To prevent an infinite loop, we create a specific user context to run the PowerAutomate updates on the list item, then we add a trigger filter to prevent new flows from starting when started by the Power Automate user.

First, add a user in the Office 365 Admin Centre

For the purpose of this example, I will call the user Power Automate.

Then the user needs to be assigned a Power Automate license (a free license is fine for many environments) and the relevant permissions on the SharePoint site that the flow will be running on.

Then you want to assign the “Update item” action to the new user you have created.

At this point, it’s worth saving and testing your flow and letting at least 2 iterations of the loop cycle through before stopping it and opening the second iteration. You will want to open and check the output.

In this scenario, I haven’t purchased an exchange license for the user so I don’t have a value for body/Editor/Email which would be preferable, so I will use body/Editor/DisplayName

"Editor":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|powerautomate@devpros.com.au","DisplayName":"Power Automate","Email":null,"Picture":null, "Department":null,"JobTitle":null}

Now that we have targeted the element we are identifying, let’s create the trigger condition by editing the settings on the flow trigger.

We will create a trigger condition and enter the expression to check if the user who modified the item was the Power Automate user we created and assigned to the step.

@not(equals(triggerOutputs()?['body/Editor/DisplayName'],'Power Automate'))

This would read in English as; The trigger output value extracted from body/editor/displayname is not equal to ‘Power Automate’

The result of this condition should be true for the flow to initialise.

Once you save and turn your flow back on, upon testing you should see each time a list item is updated, a single instance of the flow run.

Optional

If you don’t observe the desired outcome, I would recommend creating a couple of steps in your workflow to check the output of the expression.

First, check the output of the desired field by initialising a variable (initialize variable).

triggerOutputs()?['body/Editor/DisplayName']

Then check the output of your boolean condition by initialising another variable (initialize variable).

not(equals(triggerOutputs()?['body/Editor/DisplayName'],'Power Automate'))

Save and turn the flow back on. Update the list item and once at least 2 iterations have passed, stop the flow and check the second iteration.

This is the expected result, we can see the value of DisplayName is ‘Power Automate’ and the expression is false, which means with the trigger filter added, it will not run on this trigger. This information should assist you with troubleshooting the issue.

Categories
Software Development

How Your Business Can Benefit from a Customised Software Solution

Devpro in Byron Bay has helped businesses grow, expand, and work more efficiently with customised software development solutions.

Why tailor your work processes to your software when we can tailor it perfectly for you and your organisation.

For a full end-to-end software development solution, call the expert team at Devpro in Byron Bay.

What is customised software?

Customised software is designed by Devpro to better enhance your business. We look at how your business operates, and we ensure the functionality of your software enhances your processes and works with your business. Off the shelf software packages are not designed to meet your specific needs; their generic approach can be useful, but as your business grows and evolves, tailoring a customised software solution can save you time and money.

What are the advantages of software development?

Enhances your business processes.

Every business is different and off-the shelf products cannot possibly cater to the needs of all businesses. Align your business practices and processes with your software and see how seamless your organisation’s operation can be with a customised software solution.

Tailored and reliable growth

It is easy to outgrow off the shelf software, with a customised software solution from Devpro in Byron Bay your software grows with your business. Devpro provides a reliable solution that takes your business practices into account, but also future growth demands.

Your Software, your Way!

Working from home is made easy with a customised software solution, we can also tailor and app to give you ease of access wherever you might be.

Seamless Processes.

Business processes rarely work in isolation, and the flow of information from one department to another can often be tricky. Provide your employees with seamless work processes and highlight efficiency in your business. Do not put up with clunky and manual processes, get a customised software package.

Safety First

When designing your software Devpro can consult on the best security practices for customer information; we ensure that all security protocols are chosen specifically for your business demands.

Cost-Effectiveness

You might be surprised at how cost-effective a customised software solution from Devpro is. Not only is a customised solution affordable, but it will also end up saving you money in time and general IT requirements.

Yes, you might need increased capabilities as your business grows, but we can design your software so we can enhance it when you reach the next phase of your business growth, so we can do as little or as much as you need and as your budget might dictate.

Your Byron Bay Customised Software Experts.

A customised software solution from Devpro in Byron Bay is a great way to enhance your business.

A simple call to us on 1300 911 601 and we can start to understand your business and what you truly need from a software package. We are seasoned experts, and our team love rolling up their sleeves to work out the best solution for you and your business; we look at your system challenges, and how we can help better meet your businesses’ needs.

If you want a friendly and knowledgeable team that thrive on building unique and specialist software packages for businesses, then you have come to the right place. Devpro in Byron Bay are your software development team.