Hi
My requirement is to pass Parameter to PCF control in canvas app after Canvas Screen Loaded but I have added the PCF control this is rendering before the DOM loaded in Canvas app screen.
Can you tell me how can we do this?
Thanks
R.
Hi @rrizwann ,
Do you want to pass a Parameter to PCF control within your canvas app?
Based on the needs that you mentioned, I think the OnStart property of App and a available could achieve your needs. You could consider save your parameter value into a variable within the OnStart property of App, then you could reference the variable value within your PCF control.
Set the OnStart property of App to following:
Set(ParameterValue, "xxxxx Specific Value xxxx")
The OnStart property of App would be fired when you run your app (before the DOM is fully rendered within your app screen). You could reference the variable within your PCF control directly, then your PCF control would be rendered before the DOM is fully rendered in your canvas app screen.
If you want to pass a parameter value to your canvas app through the App URL Link, you could append a parameter value to the App URL link, the sample App URL Link along with parameter as below:
https://apps.powerapps.com/play/xxxxxxxx-87b2-4be1-xxxx-86529f53887a?tenantId=xxxxxxxx-f6a5-41a2-xxxx-9785a9d6c706?Param1=Test
then you could use the Param function to retrieve the passed Param1 value. Set the OnStart property of App to following:
Set(RetrievedValue, Param("Param1"))
then you could use the RetrievedValue variable in your PCF control. So when you access your app through the App Url Link (as above), the parameter value would be passed to your PCF control.
Best regards,