Power App - Eval Function

Power App - Eval Function

In this article going to show how to execute an Eval function similar JavaScript. Power Apps does not have a EVAL function or something similar  in order to evaluate mathematical expressions..

What is EVAL funtion?

The eval() method evaluates or executes an argument.

If the argument is an expression, eval() evaluates the expression. If the argument is one or more JavaScript statements, eval() executes the statements.

PCFX

This functionality is implemented using a custom control.

GitHub - juanpvy/PCFX-JavaScriptEval: PCFX Custom control that executes the EVAL Javascript function
PCFX Custom control that executes the EVAL Javascript function - juanpvy/PCFX-JavaScriptEval

We need download the managed solution , import into Power App Environment and use the control in a Canvas App.

Review the section "Install package" from this post.

Power App - create and install a custom component (PCFx)
How to create, package and import a custom code component PCFx.

How to use it?

The control has three  properties

Formula: The expresion to evaluate

Decimal places: Number of decimals to use.

Style: CSS to apply

Also the control has the "Formula Result" property that we can use in other controls.

Sé productivo. Sé extraordinario. Sé INAVANT.