I am building a dataset type pcf specifically to embed in a powerapp. This control needs to perform limited API operations ("PUT") but since we don't have a webapi in pcf for canvas, that makes this part a bit tricky.
I want to be lazy about my coding and pass the operations back up to the containing powerapp so I can handle them there--where I don't need to handle my own authentication.
Is there a way to assign value to params of type "output" such that they can be picked up by a canvas app for OnChange events, or is my only real option here to import adal and use app authentication from inside pcf?
Solved! Go to Solution.
OK, I think I have it myself, at least partially...
part 1: define the output param in ControlManifest.Input.xml:
<property name="output" display-name-key="outputVal" description-key="Output from the conrol" of-type="SingleLine.Text" usage="output"/>
part 2: define the datatype of the output in manifesttypes.d.ts:
export interface IOutputs { output?: string; }
part 3: attach your own notifyoutputchanged event to the init param:
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement)
{
this._notifyOutputChanged = notifyOutputChanged;
}
part 4: designate a return val for the type defined in manifesttypes:
public getOutputs(): IOutputs { return {output : "test"}; }
part 5: call your notifyoutputchanged event wherever in code you want the change recognized:
this._notifyOutputChanged();
part 6: in PowerApps, add your pcf control, then add a label valued as <controlname>.output
... All that still missed the onchange part, but I am sure I will figure that out eventually.
OK, I think I have it myself, at least partially...
part 1: define the output param in ControlManifest.Input.xml:
<property name="output" display-name-key="outputVal" description-key="Output from the conrol" of-type="SingleLine.Text" usage="output"/>
part 2: define the datatype of the output in manifesttypes.d.ts:
export interface IOutputs { output?: string; }
part 3: attach your own notifyoutputchanged event to the init param:
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement)
{
this._notifyOutputChanged = notifyOutputChanged;
}
part 4: designate a return val for the type defined in manifesttypes:
public getOutputs(): IOutputs { return {output : "test"}; }
part 5: call your notifyoutputchanged event wherever in code you want the change recognized:
this._notifyOutputChanged();
part 6: in PowerApps, add your pcf control, then add a label valued as <controlname>.output
... All that still missed the onchange part, but I am sure I will figure that out eventually.
Hi,
Thanks for your follow up. I am glad you were able to get this issue figured out. Thanks for the information, hopefully it can help future communities members with their issues in the future.
Regards,
Alex
-------
Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
Did you miss the call?? Check out the Power Apps Community Call here!
User | Count |
---|---|
7 | |
2 | |
1 | |
1 | |
1 |