cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kruismanp
Helper I
Helper I

MyProfile. Server return a HTTP error with code 0

The most simple screen, just a textbox. Text :  'Office365-gebruikers'.MyProfile().UserPrincipalName.

This generates the errors mentioned in the subject.

4 REPLIES 4
Anonymous
Not applicable

Hi @kruismanp,

 

I used to this error a lot. I figured out that it was coming from the Office 365 network taking too long to respond or not responding at all to the PowerApps call. 

 

To overcome this in my apps I try to use as little calls as possible to Office 365. What I do is whenever a user opens PowerApps I would gather his Office 365 information in a collection and use it through the app. This would call only once and reduce the probability of failing greatly.

 

To implement it on the main screen (the screen which opens first when users open the app) I put this function in the OnVisible property:

If(IsEmpty(UserProfileCollection),Collect(UserProfileCollection,Office365Users.MyProfile()));

 

After anywhere in your App you can always use First(UserProfileCollection).Email, First(UserProfileCollection).DisplayName, etc..

 

What the function does it first checks if the collection already exists if it does it will not pull the information from Office 365 network again. 

 

Using this I never get the Server return a HTTP error with code 0 error. Before I used to have up to 20 calls to Office365Users in one screen and the Office365 network would just not return all of them.

 

Hope it helps.

Hi,

Thanks for the response. We are aware of making less calls as possible. In this case it is one myprofile call that is treated as a variable and used filtering collections. 

 

Regards

Whitout any changes to the app, the before mentioned error that continued for hours is now absent. The profile response is swift.. 

 

Hi kruismanp,

 

I am very glad to hear that it is working for you now. I also tried this function on my side, it works as expected.

 

Best regards,

Mabel Mao

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,742)