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 / Error Validation isn't...
Power Apps
Unanswered

Error Validation isn't working properly

(0) ShareShare
ReportReport
Posted on by
If(
    IsError(Set(newID, 1/0)),
    Notify("Error"),
    Notify("no error")
)
I was just checking the above condition thinking it would Notify("Error"), but the opposite happened and it notified "no error". What is the reason here? How can we fix this?
Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    The reason you see 'no error' is that the Set function worked as it expected: it stored the <error> value into the variable 'newId'. Errors are values that can be stored (in memory, not in a connected data source) and handled later as part of the normal (non-erroneous) execution of the app.

    For example, if we have a button with an expression 'Set(inverse, 1 / Value(TextInput1.Text))', this operation will always work. If you have a label with the expression 'If( IsError( inverse ), "The inverse is an error", "The inverse is " & inverse )'

    Hope this helps!

  • michaeldanieal Profile Picture
    on at

    Thank you

  • elseb Profile Picture
    774 Moderator on at

    After you run the code, technically the code run without an error and you did set the value of your variable, the only issue is that value will be of type ‘error’, thats why you have false result of iferror.

    Thats my understanding at least.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard