In this blog, we will discuss a workaround for triggering Microsoft flow via Dynamics 365 custom ribbon button.
For this, We would place a hidden two option field on form and then we would toggle its value to true via custom ribbon button and save the record, we would need to keep the triggering point of our Microsoft flow at “When a record is updated in Dynamics 365” so it would detect the change in the record and would trigger flow, but since we would not want it to be triggered on updating of any other field so we would also add a condition which would check that our two option field value is set to true, if yes then only further flow logic should get executed else the flow would exit.
- Create a custom ribbon button: You can use XrmToolBox or Ribbon Workbench tool to create a button in your respective entity from where you may want to trigger your flow.
- Prepare Microsoft flow: The entry point of your flow will be via Dynamics 365 Connector > When a record is updated. After that first condition will be to check whether the toggle field was modified as shown in the following screenshot
- Perform your operations: Once we check the condition to make sure that the event was from toggle field and not from any other field, we would perform a send email operation (may vary depending on your requirement)
- Toggle the two options field to false: We would need to make sure that the toggle field is rolled back to false because if the field remains in as-is condition then it will be difficult to check whether the event was fired from this field or from other fields, hence make sure to rollback the value of the hidden two options field once you are done with your work.
Hope the above steps help to achieve your objective of triggering flow via Dynamics 365 ribbon button. To know more about Microsoft Flow read our blog series.