cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kruismanp
Level: Powered On

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

Re: MyProfile. Server return a HTTP error with code 0

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.

kruismanp
Level: Powered On

Re: MyProfile. Server return a HTTP error with code 0

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

kruismanp
Level: Powered On

Re: MyProfile. Server return a HTTP error with code 0

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

 

Community Support Team
Community Support Team

Re: MyProfile. Server return a HTTP error with code 0

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,160)