hi
to pass a parameter with the GUID of the current logged in user to a PowerApp embedded in an IFrame on a dashboard in Dynamics 365, you can use the following steps:
Create a custom entity in Dynamics 365 to store the GUID of the current logged in user.
Add a plugin to the custom entity that retrieves the GUID of the current logged in user and saves it to the custom entity record.
Add a web resource to the custom entity form that contains JavaScript code to retrieve the GUID of the current logged in user and call the Dynamics 365 Web API to save the GUID to the custom entity record.
In the IFrame URL for the PowerApp, add the GUID parameter and set its value to the GUID of the custom entity record.
Here are the detailed steps for each of the above:
Create a custom entity in Dynamics 365:
a. Navigate to Settings > Customizations > Customize the System.
b. Expand the Entities section and click New to create a new entity.
c. Name the entity something like "Current User GUID" and give it a unique display name.
d. Add a single text field to the entity to store the GUID.
Add a plugin to the custom entity:
a. Navigate to Settings > Customizations > Customize the System.
b. Expand the Components section and click New > Plug-in to create a new plugin.
c. Set the Primary Entity to the custom entity created in step 1.
d. Set the Message to RetrieveMultiple.
e. Set the Execution Mode to Synchronous.
f. In the Plugin Registration Tool, register a step for the plugin to run on RetrieveMultiple of the custom entity.
g. In the plugin code, retrieve the GUID of the current logged in user and save it to the custom entity record.
Add a web resource to the custom entity form:
a. Navigate to the custom entity created in step 1 and add a new field to the form.
b. Set the Data Type to Web Resource and select a new web resource.
c. Create a new web resource with type "Webpage (HTML)" and add JavaScript code to retrieve the GUID of the current logged in user and call the Dynamics 365 Web API to save the GUID to the custom entity record.
Add the GUID parameter to the IFrame URL:
a. In the PowerApp, create a new parameter to receive the GUID of the current logged in user.
b. In the IFrame URL for the PowerApp, add the GUID parameter and set its value to the GUID of the custom entity record. You can use a formula to retrieve the GUID value from the custom entity record.
With these steps, you should be able to pass the GUID of the current logged in user as a parameter to a PowerApp embedded in an IFrame on a dashboard in Dynamics 365.
DAniele