web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Canvas PCF works in Ed...
Power Apps
Unanswered

Canvas PCF works in Edit not in Play

(0) ShareShare
ReportReport
Posted on by 29

Hello,

I have a simple PCF that accept 2 strings and return 2 strings modified by MathJS library.
In dev mod, PCF works like a charm but return nothing in Dev. Any idea? I bet a coin on "usage".

 

With simple usage : textbox, result in label is OK

with complex usage : variable inside the input = does not refresh

 

ManifestTypes.d.ts

 

 

/*
*This is auto generated from the ControlManifest.Input.xml file
*/

// Define IInputs and IOutputs Type. They should match with ControlManifest.
export interface IInputs {
 stringToEvaluate: ComponentFramework.PropertyTypes.StringProperty;
 arrayToEvaluate: ComponentFramework.PropertyTypes.StringProperty;
 calculation: ComponentFramework.PropertyTypes.StringProperty;
 calculationArray: ComponentFramework.PropertyTypes.StringProperty;
}
export interface IOutputs {
 calculation?: string;
 calculationArray?: string;
}

 

 

 ControlManifest.Input.xml

 

 

<property name="stringToEvaluate" display-name-key="String to be Evaluated" description-key="myString" of-type="SingleLine.Text" usage="input" required="true" default-value="3+4" />
 <property name="arrayToEvaluate" display-name-key="Array to be Evaluated" description-key="myString" of-type="SingleLine.Text" usage="input" required="true" default-value="3+4" />
 <property name="calculation" display-name-key="Calculation result" description-key="myString" of-type="SingleLine.Text" usage="bound" required="true" />
 <property name="calculationArray" display-name-key="CalculationArray result" description-key="myString" of-type="SingleLine.Text" usage="bound" required="true" />

 

 

Index.ts

 

 

public updateView(context: ComponentFramework.Context<IInputs>): void
 {
 // Add code to update control view
 this._notifyOutputChanged();
 const math = create(all)
 const _vExpression=this._context.parameters.stringToEvaluate.raw
 const _vExpressionArray=this._context.parameters.arrayToEvaluate.raw

 const ans = math.evaluate(_vExpression as string)
 this._expression=math.format(ans)

 if (_vExpressionArray !== null) {
 const ans2 = math.evaluate(Array( JSON.parse(_vExpressionArray)));
 this._expressionArray=math.format(ans2) // okay, myString is guaranteed to be a string
 console.log(ans2)
 }

 
 }

 /**
 * It is called by the framework prior to a control receiving new data.
 * @returns an object based on nomenclature defined in manifest, expecting object[s] for property marked as “bound” or “output”
 */
 public getOutputs(): IOutputs
 {
 return {
 calculation:this._expression,
 calculationArray:this._expressionArray
 }as IOutputs;
 }

 

 

 

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard