Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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;
 }

 

 

 

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard