Wednesday, December 9, 2020

How to trigger Power Automate during debug, test and production stage, to prevent infinite loop, with SharePoint item events

Some post recommends to set up a extra column to apply the control. It definitely works, but it needs extra column and extra actions.

Here is something much easier.

1. Define at least three dedicated user accounts

For example, tester1@company.com, developer1@company.com, PowerAutomateService@company.com

The first two accounts are for tester and developer. Power Automate runs under PowerAutomateService@company.com.

2. Change the settings of the trigger conditions


During debugging:

@equals(triggerOutputs()?['body/Editor/Email'],'developer1@company.com')

During testing:

@equals(triggerOutputs()?['body/Editor/Email'],'tester1@company.com')

During production:

@not(equals(triggerOutputs()?['body/Editor/Email'],'PowerAutomateService@company.com'))


PS: It needs three extra user subscriptions in this case, but hopefully our company doesn't mind.

No comments:

Post a Comment