cancel
Showing results for 
Search instead for 
Did you mean: 

Error handling inside PowerApps (Try-Catch)

My idea come with error message that is being thrown when trying to get manager of user via Office365 Users connector. More details here - https://powerusers.microsoft.com/t5/General-Discussion/Office-365-Users-ManagerV2-Error/m-p/119173.

 

As this is expected error that will be delivered by this connector it will be nice to have some option inside PowerApps to catch it and instead of displaying this for user of PA as "nothing to say" message, to diplay something like no manager found and this can lead to some other actions ...

P.

Status: Under Review

Sorry, I meant to add this as under review. It has been on our radar to improve this experience. Adding @SameerCh to comment on roadmap.

 

Thank you for your patience,

Audrie

Comments
Flow Staff
Status changed to: Completed

Adding @SameerCh as FYI

Flow Staff
Status changed to: Under Review

Sorry, I meant to add this as under review. It has been on our radar to improve this experience. Adding @SameerCh to comment on roadmap.

 

Thank you for your patience,

Audrie

Level: Powered On

do we have an update on this yet? the powerapp which i'm working is functioning as expected however users are reporting this error they are seeing on app launch and it is quite a hassle to explain to every user to ignore these errors each time someone approached me about it.

Level: Powered On

Hi,

How about this topic?

 

I have a Patch inside a ForAll attacking a custom 365 entity and I have to catch the possible errors from the functionality in 365.

 

Thank you!

Level: Powered On

Hi, Is there any update or workaround for this yet? I have the same issue as vecerpa and the IfError() doesn't catch it. 

Thank you

Level: Powered On

I have the same Isssue too , any Update ?  any workaround ? 

Level: Powered On

I found a workaround for this I believe.  My "Manager" field is a people picker.  Choices are all people.  Then I added a label to the card that is not tied to any data field.  For the label I check the LEN of the user's manager, if there is no manager the LEN comes back as 0.  There is an error on the label field if there's no manager, but it does not seem to affect the functionality of the form.  So on the Manager field I check the label value (containing the LEN of my manager's display name)....if it's 0 I don't retrieve the user's manager....if it's greater than 0 I set the Manager field to the user's manager.

Level: Powered On

@AmyRock Can you provide sample formula?

In particular I'm interested to know the people picker on how you have it autopopulate manager information before user enters the information manually.

 

Shouldn't the app spit out the error if there's no manager for that user?

Level: Powered On

@asri_zainal I did something easier today.  On my screen's OnVisible property I added:

 

UpdateContext({varDefaultSelSmiley Surprisedffice365Users.MyProfile()});

If(Not(IsBlank(Office365Users.Manager(varDefaultSel.Id))),
UpdateContext ({varManager: Office365Users.Manager(varDefaultSel.Id)}))

 

Then, on my form, for the DefaultSelectedItems of the people picker field (that I want to default to the user's manager if they have one) I added:

 

if(Not(IsBlank(varManager)),{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:Concatenate("i:0#.f|membership|",varManager.Mail),
Department: varManager.Department,
DisplayName: varManager.DisplayName,
Email: varManager.Mail,
JobTitle: varManager.JobTitle,
Picture:""
})

 

When I open the screen with the form, the Manager field will display my manager from AD if I have one, if not the field is blank and I receive no error.  At least today Smiley Happy

Level: Powered On

@AmyRock Are you sure you are not getting any error if a user(who does not have a manager) use the app? Smiley Surprised

 

UpdateContext({varDefaultSel: Office365Users.MyProfile()});

If(Not(IsBlank(Office365Users.Manager(varDefaultSel.Id))),
UpdateContext({varManager: Office365Users.Manager(varDefaultSel.Id)}))

I created a new blank screen with just those code above in OnVisible and are getting error launching that screen.

 

We have not even gotten to the people picker yet.

 

Capture.PNG

 

Capture1.PNG