Blogs

Invoker’s Connection in Power Automate

, September 24, 2024605 Views

We’ve been using Power Automate extensively to automate operations in Dynamics 365 using the Dataverse connectors.

Also, working with connectors in Microsoft Dataverse, using a connection reference is generally a good practice. However, there’s an exception: if you want to perform a Dataverse operation in the context of the person who triggers the flow (the Invoker), then you should avoid using a connection reference instead use “Invoker’s Connection”.

Purpose of using “Invoker’s Connection” in Power Automate:

  • The flow executes with the permissions of the user who starts it, ensuring that actions within the flow only have access to the data and resources that the initiating user has permissions for.
  • The flow can be used by multiple users without needing to configure individual connections for each user.
  • Administrators do not need to maintain or update credentials for a fixed connection.

In the past, there was no way to run a Power Automate flow in the user’s context, but now you can do so specifically for Dataverse actions using the “Invoker’s Connection”. Please refer to the image below for a better understanding.

As seen in the image, we have used “Invoker’s connection” for the Dataverse action named “Create Contact”. Therefore, the system will create a contact using the “Invoker’s” user.

Advantages:

  • Records (If created by Power automate) will not be owned by a single Peron, which will be helpful for the admins to manage the data.
  • Using the invoker’s connection ensures that actions are performed under the user’s identity, which may be required for auditing and compliance purposes. It provides a clear audit trail of who performed specific actions within the flow.
  • Users will only be able to perform operations they have permission for. If a user lacks specific permissions, such as create, update, or delete, Power Automate will throw an exception, and the operation will not be executed.

Disadvantages:

  • It is only available for “Dataverse” connectors.

Previously, as the operation were performed by a global user, any permission issues were not encountered because the global user was having the required permissions of every entity but now if the operations gets executed on behalf of the logged-In User and by any chance if the user will not have the required permissions like create, updated or delete, then the flow run might fail.