Introduction: In this blog, we will understand how we can run(call) MS Flows from Model-driven apps(D365 CE).
We will understand “When a record is selected” trigger of Common Data Service.
Use Case: You want to send follow-up emails to the selected opportunities and update the status of the opportunity to On-Hold.
Steps to be followed:
- Create Flow inside a Solution in Power Automate.
- Search for Common Data Service connector and select “When a record is selected” trigger.
- Select Environment and Entity Name from the drop down.
- Select the entity from where you want to run the flow.
- You can also take user input.
- Select the send email action.
- Enter the email address of the Customer from Dynamic content
- Enter the Subject and Body of the email based on your requirement.
- Update the status of opportunity.
- Select the Update record action
- Select the Entity name and enter the Item ID(Guid) from the dynamic content.
Running the Flow:
- Select the opportunity on which you want to run the flow.
- Click on Flow –> Select the Flow which you want to run
- Click on Run flow