Sometimes, you might need to change the trigger of a flow in Power Automate. In this tutorial, I have explained how to change trigger in Power Automate using different ways.
Suppose there is a flow and the trigger is “When an item is created or modified,” and later, you want to change it to “When an item is created”. Here, I will show you different ways to do it.
When we are developing a flow, we may select the wrong trigger action, or later, we realize that we need to change the trigger action. We may lose the following actions presented in the flow because of the false trigger action.
To overcome this, we will see how we can change the trigger type without losing the following steps that are presented in the flow:
How to Change Trigger in Power Automate
Let us see how to change the trigger in Power Automate.
Example-1: (Change Trigger Directly)
Here, I have created an instant cloud flow with two text inputs called Employee Name and Designation.
I have added two compose data operations to display the EmployeeName and Designation values from the dynamic content value as below:
- Now, I want to change the old trigger action and then have to add a new trigger action.
- Changing the trigger action is easy; we can select the ellipse and choose the delete option, which deletes the existing trigger, as highlighted below.
A popup appears as a Power Automate warning; this step and associated dynamic content will be deleted from this flow.
Select the OK button, which also deletes the dynamic content values used in further actions presented in our flow.
We must select this OK button to change or delete the old trigger action.
The screenshot below shows that the trigger has been removed, and the dynamic content values used in the compose data operation are removed from the flow.
Power Automate does not warn when the dynamic content values are missing in our flow. Here, when we select any other trigger action.
We have to go through the flow to check and replace the dynamic content reference value passed from the old trigger action and replace them; when it is a single input value required field, we will get a message like the highlighted below and pass the new trigger action dynamic content value in it.
We can copy actions to the clipboard to retain trigger references to overcome this. In the below example, I’ll show how to do it.
Example-2: (Copy all action to clipboard)
In this example, we can change the trigger action by coping with all the remaining actions presented in the flow.
In this example, I am going to use the below SharePoint list.
Here, I have created an automated cloud flow with the trigger when an item is created or modified.
Added two compose data operations to display the Technology field value (default title column) and Description field value as shown below:
Follow the below steps to achieve this:
1. Expect the trigger action and add all the remaining actions presented in the flow into one scope action. For that, add a new step and choose the Scope control under actions.
2. In the screenshot below, you can see that I have added all the actions into the scope control except the trigger action.
3. Copy the scope control action to the clipboard to retain all the dynamic references.
4. Now, I will change the old trigger action ‘when an item is created or modified‘ to the ‘when an item is created‘ trigger action. Delete the Existing trigger by selecting ellipses and choosing the delete option; it will also delete the dynamic reference used in the flow.
5. Select the new trigger action from the action triggers or create a new flow with the correct trigger action and Paste the scope control from the My Clipboard, which retains all the dynamic references.
Here, I have changed the trigger action from ‘when an item is created or modified‘ to the ‘when an item is created‘ trigger action. Add a new step and choose Scope control action from My clipboard; it will add the actions with the dynamic content values.
6. Once the scope control has been added to flow it looks like below: Now delete the existing scope control action:
7. Save and Run the flow; the flow will only trigger when a new item is created in the SharePoint list. Here, I have created the below highlighted list item:
8. Once the flow runs successfully, we can see the created item Technology field and Description field value in the compose data operation.
Example-3: (JSON key-Value Pair)
In this example, I will show you how to change the trigger, recreate the reference in compose data operation with JSON format, and use the output of the trigger in the complete flow.
I am going to use the below Technology SharePoint list:
Here, I have created an automated cloud flow when an item is created trigger. Configure the SharePoint site address and List Name.
Added a compose data operation, Add passed the JSON code below: which returns the value from trigger action.
{
"Technology": "@{triggerOutputs()?['body/Title']}",
"Description": "@{triggerOutputs()?['body/Description']}"
}
outputs('Compose_-JSON')['Technology']
outputs('Compose_-JSON')['Description']
Now, I am going to change the trigger action from ‘when an item is created‘ to ‘When an item is created or modified’.
1. Delete the Existing add the new trigger action, and configure the required parameters: Here, I have deleted the ‘when an item is created‘ and added the new trigger action as ‘When an item is created or modified’.
2. In the compose data operation JSON code format, pass the output of the trigger action, If change only for the particular action, the further steps will not break in Flow.
3. Save and Run the flow. Here, I have modified the below-highlighted list item:
4. Once the flow runs successfully, we can see the expected output: If we change the value only for the JSON code format from the trigger action the further steps will run without any break.
This is how to change the trigger in a Power Automate flow.
Example-4: (Change the trigger during the Approval Process)
In this example, we will see what happens when we change the trigger action during the approval process and whether the existing item will be affected or not when we change the trigger action.
Here, I am going to use the below SharePoint list.
Follow the below steps to create a flow to change the trigger during approval process:
1. We created an automated cloud flow, with the trigger when an item is created or modified. Provide the SharePoint site address and List Name.
2. Add three compose data operations to get the ID, Manager’s Email, and UserName
triggerOutputs()?['body/ID']
triggerOutputs()?['body/Manager/Email']
triggerOutputs()?['body/Title']
3. Select +new step and add the “Start and wait for an approval” action specifying the start of a Manager approval process. This action has below fields:
- Approval type: Select an approval type as “Approve/Reject – First to respond” from the drop-down.
- Title: Pass the output of the user name from the Dynamic content.
- Assigned to: pass the dynamic content of the manager’s email.
4. Now check the condition if the Outcome is equal to Approve. If yes, use the Update item action to update the status as Approved and send an email to the user that the leave request has been approved.
In the Update item action, configure the SharePoint site address and List name. In the ID pass the ID of the compose data operation from the dynamic content; in the status field from the dropdown choose Approved.
Add a new step and choose Send an email (V2) action, Enter the required fields in the TO, pass the requested user email address, and provide the subject and the body of the email.
Similarly, If No, use the Update item action to update the status as Rejected and send an email to the user that the leave request has been rejected; in the status field from the dropdown, choose Rejected.
Configure the SharePoint site address and List name in the Update item action. In the ID, pass the ID of the compose data operation from the dynamic content, and in the status field from the dropdown, choose Rejected.
Add a new step and choose Send an email (V2) action, Enter the required fields in the TO, pass the requested user email address, and provide the subject and the body of the email.
5. Save and Run the flow. Here, I have created the below-highlighted list item:
Now the flow is running; the manager didn’t select either approve or reject.
6. Now I am going to change the trigger action from ‘when an item is created or modified‘ and add the new trigger action as ‘When an item is created‘ as below: Also, pass the reference from the dynamic content values in the compose data operation for the changed trigger.
7. Now save and run the flow here I have created a new item as highlighted below:
The flow will run only if the managers approve or reject the leave request. Here I have rejected the leave request for approval. Once the flow runs successfully, like below:
It updates the value as rejected in the status field below for the newly created item:
Also, send an email that the request has been rejected. Here for testing purposes, I have used a created by-email address.
- Now, for the existing item, The flow runs successfully only if the manager approves the leave request. It updates the status field as Approved and sends the email.
- For the existing item, if we modify any changes, the flow will not trigger again because we have changed the trigger action from ‘when an item is created or modified‘ and added the new trigger action as ‘When an item is created‘.
Here, I have approved the leave request for approval, so the flow runs successfully:
In the SharePoint list, we can see that the status field gets updated as Approved.
Also, the user will receive an email like below: Here for testing purposes, I have used a created email address.
This is how to check whether the existing item will be affected or not when we change the trigger action in Power Automate.
Conclusion
I hope you get an idea to change the trigger action in the Power Automate. Here, I have shown you three ways to change trigger in Power Automate flow.
In the first example, I have shown you to delete the existing trigger and create a new one. In the second example, I have shown you how to use the My Clipboard feature from a Scope control action.
In the third example, I have shown you how to change the trigger values in the JSON code format, so that it will not break any further steps in flow when we change the trigger action in Power Automate flow.
Finally, I have shown you what happens when we change the trigger action during the approval process, and whether the existing item will be affected or not when we change the trigger action.
You may also like:
- Trigger Conditions in Power Automate
- Power automate approval reminder
- Power Automate update SharePoint list item
- How to get SharePoint list items using Rest API in Microsoft Power Automate
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.