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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard