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

Community site session details

Session Id : wN0gmR2+fM1egvw9Raz9da
Power Apps - Building Power Apps
Answered

Error Validation isn't working properly

Like (0) ShareShare
ReportReport
Posted on 17 Apr 2024 13:24:12 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)
  • elseb Profile Picture
    768 Moderator on 17 Apr 2024 at 13:35:44
    Re: Error Validation isn't working properly

    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.

  • michaeldanieal Profile Picture
    on 17 Apr 2024 at 13:32:46
    Re: Error Validation isn't working properly

    Thank you

  • Verified answer
    CarlosFigueira Profile Picture
    on 17 Apr 2024 at 13:28:18
    Re: Error Validation isn't working properly

    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!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 892 Most Valuable Professional

#2
Power Apps 1919 Profile Picture

Power Apps 1919 356

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 310 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete