cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
liun
Level: Powered On

Passing in PCF parameters at RUNTIME in PowerApps

Hello all - 

 

Currently the properties defined in the menifest can be setup and configured at DESIGN time in the form designer.

 

It is also possible to passing the input paramters at RUNTIME in the harness debug app. 

 

However, is it possible to passing in parameters at RUNTIME in Powerapps/Dynamics, via form script? Basically inject values into the "context" for controls of type "customcontrol:****"

 

if so, how? If not, will that be a feature coming?

 

Thanks!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MinRao
Level: Powered On

Re: Passing in PCF parameters at RUNTIME in PowerApps

I have following idea but have not tried yet . hope we can discuss in this post. ( whether this would work or not and if it works whether it is a recommend or not,  also anything need to be careful.) 

 

 -  Bound component to string text field A on the form. 

 -  Set field A 's submit mode 'never' onload of the form.

 -  Interact form and component using this field A by following approach

     - Component to Form :  Pass json string from getOutputs from component to form. field A's onchange should be trigger and you can get this json string.

     - Form to Component :  Setvalue of the field A should trigger component's updateview, you can get waht you want  by context.paramters.xxx.raw.

 

 

View solution in original post

2 REPLIES 2
MinRao
Level: Powered On

Re: Passing in PCF parameters at RUNTIME in PowerApps

I have following idea but have not tried yet . hope we can discuss in this post. ( whether this would work or not and if it works whether it is a recommend or not,  also anything need to be careful.) 

 

 -  Bound component to string text field A on the form. 

 -  Set field A 's submit mode 'never' onload of the form.

 -  Interact form and component using this field A by following approach

     - Component to Form :  Pass json string from getOutputs from component to form. field A's onchange should be trigger and you can get this json string.

     - Form to Component :  Setvalue of the field A should trigger component's updateview, you can get waht you want  by context.paramters.xxx.raw.

 

 

View solution in original post

liun
Level: Powered On

Re: Passing in PCF parameters at RUNTIME in PowerApps

@MinRao 

Thanks!

This can be a reasonable workaround before "Unbounded Control" is available:

https://powerusers.microsoft.com/t5/PowerApps-component-framework/Unbounded-Controls/m-p/316409#M553

 

My use case is displaying various data on the form that do not need to be saved in DB, but the calculation is more complex than calculated field can handle and has to be done by javascript code. 

 

The only thing seems unexpected is that in the form to component, updateView is not always triggered, if setValue is been called multiple times within a small timewindow https://powerusers.microsoft.com/t5/PowerApps-component-framework/updateView-is-not-called-on-every-.... But it can be resolved by accumulating values in the JSON object. 

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Users Online
Currently online: 404 members 4,655 guests
Please welcome our newest community members: