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 / Evaluating a calculati...
Power Apps
Unanswered

Evaluating a calculation string possible in powerapps?

(0) ShareShare
ReportReport
Posted on by 704

Hi,

 

Is in in anyway in powerapps possible that a string like

"2 + (4*3)"

or

"1,2 * (12^0,7)"

is evaluated to its mathematical result at runtime in powerapps?

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @HansHeintz 

     

    Can you please share more details about this? I want to understand how you are generating the dynamic expression. If there is a specified format that will be used, then you can use the expressions directly.

     

    E.g. If you want to evaluate "2 + (4*3)" on button click, you can set the OnSelect property of the button control as:

    Button -> OnSelect -> 2 + ( 4 * 3 )

     

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • HansHeintz Profile Picture
    704 on at

    for example: I
    want users to express the upper norm level of a blood test as a realtion to theor weight: 60+ 1,2*G

    Where G is weight. I can then substitue the weight of a patient for G and have software evaluate the result. Also i want users to express the dosage of a medicin as 0,2*G^0,7 (dosage being linear relative to body surface and not weight,which makes a big difference with various types of dogs
    These are just examples. I might work around these particular examples but it would be nice if an expression parser might be available through powerapps

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @HansHeintz 

    Simple calculations can be done using mathematical operators like those you referred to.  

     

     0,2*Label1.Text^0,7

     

    without using strings.  _1.png In the example on the left your function is the text property of a label that references a control and would be dynamic.  

  • HansHeintz Profile Picture
    704 on at

    I don’t want to sound ungratefull but that is whst i mean with working around the examples. 
    i mean something like this

    https://awesomeopensource.com/project/ArashPartow/exprtk

    meanwhile i guess answer is: not possible

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @HansHeintz 

     

    I am afraid but this is not supported as per current capabilities, if you think this should be added, then please raise an idea or upvote if exists already here: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas 

     

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • StephenDear Profile Picture
    6 on at

    Similar to Arach's solution, you could parse the string for numbers and formula elements and evaluate them that way. Would be a big job in Power Automate though, think this would fit better in an Azure function to be called from your flow/logic app. 

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard