cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to pass run time Parameter in PCF control in Canvas ?

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.

1 REPLY 1
Highlighted
Community Support
Community Support

Re: How to pass run time Parameter in PCF control in Canvas ?

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (10,581)