cancel
Showing results for 
Search instead for 
Did you mean: 

Allowing access to PCFControl instance from client API

Per forum thread https://powerusers.microsoft.com/t5/PowerApps-Component-Framework/Form-designer-setting-additional-m...

 

Basically, I am looking for scripting capability of PCFControls in forms. The solution can be just one extra method in the parent control instance to return the reference of the PCF.

If the PCF is

export class DogPCFControl implements ComponentFramework.StandardControl<IInputs, IOutputs> {
.. getOutPut(){
}
// additional custom method we'd like to expose to client
public bark():void {
  alert("woof");
}
}

in client API:

 

var ctrl = formContext.getControl ("someattribute");
if (ctrl.getControlType() == "customcontrol:MyNameSpace.DogPCFControl") {
    var mypcf= ctrl.getCustomControl(); // this is the asked feature, and can be generic enough with minimal API change
    mypcf.bark(); 
} 
Status: New