cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AakashJaiswal
Helper V
Helper V

If error() / If (IsError()) not executing properly

Hi,

I am trying to create an error handler. However, after the execution of the error statement, false statement (when using If(isError) ) is not executing. 

 

 

 

 

If(
    IsError(
        'OneNote(Business)'.CreateSectionInNotebook(OneNoteKey,{name:TaskID_var}); //create one note section
    ),
    UpdateContext({Submitform_error:true}),
    UpdateContext({Submitform_error:false})
)

 

 

 

 

Whether the error exists or not, the code is executing the false condition in all scenarios. After code execution the button highlights the error in the one.note statement but doesn't execute the true condition. Following is the screenshot.

 

Screenshot (445).png

 

P.S: I have already enabled iferror experimental feature in settings

Marking @v-xida-msft @WarrenBelz  @v-monli-msft  @eka24  @PowerAddict @mdevaney  for your help.

 

Aakash

1 ACCEPTED SOLUTION

Accepted Solutions
alrez
Community Support
Community Support

Hi,

 

Looking through this, this appears to be fine. I dont see anything that sticks out to me on what could be causing the issue. Maybe this would be a better question for Microsoft Support since it doesn't appear that the communities knows the answer to this. I will include a link on how to create a ticket if you want to go down that route. Otherwise if any other communities members know what is occurring here, feel free to chime in.

 

If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
alrez
Community Support
Community Support

Hi,

 

Looking through this, this appears to be fine. I dont see anything that sticks out to me on what could be causing the issue. Maybe this would be a better question for Microsoft Support since it doesn't appear that the communities knows the answer to this. I will include a link on how to create a ticket if you want to go down that route. Otherwise if any other communities members know what is occurring here, feel free to chime in.

 

If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Drrickryp
Super User
Super User

Hi @AakashJaiswal 

Could the semicolon at the end of this line be wrong and should be a comma?

If(
    IsError(
        'OneNote(Business)'.CreateSectionInNotebook(OneNoteKey,{name:TaskID_var}); 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,120)