When we use the Cloud Flows integration in Power Pages, we can use Web Roles to restrict what users can call the Flow or not.
But sometimes only this is not enough and we might want to add more logic in the Flow to prevent certain actions. For instance, you can validate the Contact ID against Dataverse records to ensure the user has the right to execute certain actions.
Check out how you can do it.
Contact ID in the Trigger
Every Power Pages user is mapped to a record in the Contact table in Dataverse. If we have a look at the properties that Power Automate provides us in the Power Pages trigger:
![](https://i0.wp.com/michelcarlo.com/wp-content/uploads/2024/04/ppagestrigger-1.png?resize=360%2C329&ssl=1)
Note that there is a User ID returned in the ‘When Power Pages calls a Flow’ trigger. This User ID is exactly the same as the Contact ID in Dataverse.
Validating Contact against records
Imagine a scenario where you want to perform actions against Dataverse records in Power Automate. You can use Power Automate to call actions not available natively or even call
Source link
More About This Author
![michelcarlo](https://i0.wp.com/365community.online/wp-content/uploads/2020/04/C6zQCIg6_400x400.jpg?resize=150%2C150&ssl=1)
-
SharePoint and Office 365 Consultant/Developer always trying to get the best from Microsoft stack (Microsoft 365/Azure/Power Platform and related stuff).
Living in Ireland since 2018, I had previously worked in Brazil as a consultant/developer for Office 365, SharePoint and related technologies for almost 10 years.
Array
Modern Workplace24 July 2024Power Pages Table Permissions: Configure permissions to see records from child Accounts
Modern Workplace15 July 2024Copy Dataverse contact phone numbers across different environments based on Contact e-mail address using Power Automate
Modern Workplace1 June 2024Get the current logged Power Pages user Contact ID via JavaScript and use it to create records assigned to the current user
Modern Workplace11 May 2024How to get the current Azure Devops iteration name for a project using Power Automate