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 / 'Evaluate' function in...
Power Apps
Answered

'Evaluate' function in Powerapps

(0) ShareShare
ReportReport
Posted on by 162

Hello,

 

I was wondering if powerapps has a function like the Excel Evaluate function.

 

In my app I have 2 fields:

1. Measured value = DataCardValue16 with value of '5'

2. Specification = DataCardValue16 with value of '<7'

 

Behind both fields I want to add a icon who tells the outcome. So a check icon when DataCardValue16 falls within the specification mentioned in DataCardValue17 and a cancel icon when DataCardValue16 does not meet the specifications.

 

Is this possible? The calculation symbol < can also be <=, >=, > and =.

 

Thank you for you kind cooperation.

 

Kind regards,

 

Hans

 

 

 

Categories:
  • TheRobRush Profile Picture
    11,128 Moderator on at

    For 1st, just do something like this in the visible of the icon

    DataCardValue16.Value=5

    And for 2nd

    DataCardValue16.Value >7
  • Rapaille Profile Picture
    162 on at

    Hello TheRobRush,

     

    Thank you for your answer, I think I wasn't clear. The calculation can be different for each item. For examples see below.

     

    In Excel I would use =Evaluate([@[Measured value]]&[@Specification]) and that's what I'm looking for in Powerapps.

     

     

    Rapaille_2-1667414170610.png

     

     

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Judging solely off the screenshot you shared, it is not clear what variable is being evaluated.

     

    Are there only ever certain product types, IE) A/B/C and their measured value and spec values will always be evaluated against a value stored in datacardvalue16 and datacardvalue17?

  • Rapaille Profile Picture
    162 on at

    There a lot of products in the list with each a different agreed specification in datacardvalue17. The specification (datacardvalue17) is already in the SharePoint list and the measured value (datacardvalue16) will be filled out by the user. 

     

    What I want is a function/formula which looks if the measured value is within specification.

  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    Unfortunaly PowerApps don't have any function to directly evaluate a string but you can use regex and conditions to achieve what you want, like this:

    Set(
     varEvaluate,
     With(
     {Number: Value(Match(DataCardValue17 ,Match.MultipleDigits).FullMatch)},
     If(
     ">=" in DataCardValue17 ,
     DataCardValue16 >= Number,
     "<=" in DataCardValue17 ,
     DataCardValue16 <= Number,
     ">" in DataCardValue17 ,
     DataCardValue16 > Number,
     "<" in DataCardValue17 ,
     DataCardValue16 < Number,
     "=" in DataCardValue17 ,
     DataCardValue16 = Number
     )
     )
    )

    Here I set a variable with the result of this evaluation

     

    I hope it helps 🙂

  • Rapaille Profile Picture
    162 on at

    Hello victorcp,

     

    Thank you helping me. I tried your code, but I have a error. What should I do difference.

     

    Rapaille_0-1667493905430.png

     

  • Verified answer
    victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    sorry I miss understood you, I thought you want to create a function to evalute the expression.

    In this case try this:

    With(
     {
     Number: Value(DataCardValue16.Text),
     NumberToCompare: Value(Match(DataCardValue17.Text,Match.MultipleDigits).FullMatch)
     },
     If(
     ">=" in DataCardValue17.Text || "=>" in DataCardValue17.Text,
     Number >= NumberToCompare,
     "<=" in DataCardValue17.Text || "=<" in DataCardValue17.Text,
     Number <= NumberToCompare,
     ">" in DataCardValue17.Text,
     Number > NumberToCompare,
     "<" in DataCardValue17.Text,
     Number < NumberToCompare,
     "=" in DataCardValue17.Text,
     Number = NumberToCompare
     )
    )
  • Rapaille Profile Picture
    162 on at

    Hello victorcp,

     

    Your help is much appreciated. I tried above code and still received an error. When I replaced all instances of 'DataCardValue17.Text' with 'DataCardValue17.Selected.Value' it worked. Don't ask me why. 🙂

     

    Thanks again, my issue is solved.

  • victorcp Profile Picture
    2,350 Moderator on at

    Great! please accept the previous message as solution to help me and others who might have the same issue.

     

    Thanks!

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard