We can use the tag parameter in the request to pass any additional information to the plugin. This is added as a shared variable to the plugin execution context.
Below we are creating a lead record and passing the tag parameter in the CreateRequest

And below is our plugin, that gets the tag parameter passed from the shared variable collection.

We can see the value of the tag parameter in the trace log.

Below is an example of where we are passing it in UpdateRequest


The trace log –

Also, the tag parameter is immutable, once set from the API, its value cannot be changed.

Below we had the same plugin registered in pre and post-operation, and we were getting the same value for the tag passed during the create request.


As per the Microsoft documentation, we can use this field to pass any additional details from the client application, that we can use to apply specific logic in the plugin.
Get more details here
Refer to for more details
Hope it helps..
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

2 thoughts on “Use tag parameter to add a shared variable to the plugin – Dataverse / Dynamics 365”