Let’s say that you want to run a Power Automate Flow on a set of Dataverse records and those records will be referenced in your C# Plugins.
And the next steps is you’ll create an Action for this and register it in the Plugin Registration Tool.
In case you are new to plugins in CRM, you can refer this series – Plugins Development in Dynamics 365 CRM for Beginners | [Blog Series]
Bound Action in CRM
Let’s suppose you are aware on how to create Actions in Dynamics 365 CRM. This is an old concept since many years and I’m also assuming you know how to profile a plugin (which is registered as an Action in CRM) –
- When you open an Action, let’s suppose you are passing Account as well as a Contact Entity to the Action itself.
Notice that the Action is registered as a Bound Action on the Account entity already. - Also, assuming that you have Activated this Action and then registered this Action as a Step on the Plugin in the Plugin Registration Tool.
Now, let’s see how we can pass the parameters to the plugin itself from the Flow
Power Automate Flow – Bound Action
You must’ve used the Dataverse connector a lot, so here’s how you can call the Bound Action and pass the Entity parameters to the Action itself –
- You’ll need to use a Perform a bound action action in Power Automate which is offered by Dataverse connector.
- Then, select the Table which you have registered the Action on in CRM and you’ll then see the Action’s backend name appear for selected, then pass the primary key of the record.
- Now, since there are 2 Entity parameters to be passed for the Action, here’s you’ll see all the fields from those Entity itself!
- For each of these Entity parameters, you have to look for the Primary Key field of those tables and then pass the GUIDs of the Entity records you presumably have.
- But wait! There’s a limitation here. You can only have 1024 parameters saved for the step selected. Hence, only 1 lookup will suffice.
You’ll get the below error when trying to set both the Lookups that I’m passing to the action above.
The error says “The dynamic schema response from API ‘commondataserviceforapps‘ operation ‘GetMetadataForBoundActionInput‘ is too large, only schemas with at most 1024 properties are supported.“ - Hence, I’ll go back and remove 1 Entity parameters just for this example to work!
- And then, I’ll simply profile the Plugin Action to see what is passed in the InputParameters.
Plugin Context
Now, given that you might have already Profiled the plugin and attached it to the Plugin Registration Tool process, let’s examine the context’s Input Parameters –
- the InputParameters in the plugin’s execution context will contain the following parameters, which we’ll see in later section of this blog post.
Target [EntityReference, in a CRUD operation registered plugin step – Target is an Entity in the plugin context]
AccountRecord [Entity]
Considerations
Here are some considerations if you want to make design decisions for your implementation –
- Cannot have 2 or more Entities as parameters as the Perform a bound action step itself has limitations of 1024 properties at the Power Automate level.
- Pass some other Entity than the Action you have registered on since you’ll get the registered Entity as EntityReference itself in the “Target” parameter.
Hope this was useful!
Here are some Power Automate posts you want to check out –
- Select the item based on a key value using Filter Array in Power Automate
- Select values from an array using Select action in a Power Automate Flow
- Blocking Attachment Extensions in Dynamics 365 CRM
- Upgrade Dataverse for Teams Environment to Dataverse Environment
- Showing Sandbox or Non Production Apps in Power App mobile app
- Create a Power Apps Per User Plan Trial | Dataverse environment
- Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
- Co-presence in Power Automate | Multiple users working on a Flow
- Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
- Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
- Call a Flow from Canvas Power App and get back response | Power Platform
- FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
- Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
- Asynchronous HTTP Response from a Flow | Power Automate
- Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
- Converting JSON to XML and XML to JSON in a Flow | Power Automate
Thank you!