cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AIUYM19
Advocate V
Advocate V

Office365User stopped working

For months, the following code has been working just fine in the OnChange property of a combobox.

UpdateContext({
    Escalation1: Office365Users.ManagerV2(First(cmbCreateNewAssignee.SelectedItems).Email),
    Escalation2: Office365Users.ManagerV2(Escalation1.mail),
    Escalation3: Office365Users.ManagerV2(Escalation2.mail)
})

However, it just stopped working suddenly today. Now, I receive the error, "Office365Users.ManagerV2 failed: The method ManagerV2 has an invalid value for parameter 'id'." The line for Escalation2 is identified as the source of the error. When I remove "Escalation1.mail" from the id parameter, and then simply re-enter "Escalation1.mail" for the same parameter, PowerApps stops complaining.

The thing is, while I'm in edit mode, the code still works just fine (verified using a test label object). But as soon as I switch to play mode, the same error is thrown. What is going on? I've already logged out and in again, cleared my cache, and rebooted, but the issue persists.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AIUYM19 

You're most likely dealing with a timing issue...PowerApps is trying to evaluate the Formula you have all together and the initial Escalation1 is empty.

Try to break your formula out:

UpdateContext({Escalation1: Office365Users.ManagerV2(First(cmbCreateNewAssignee.SelectedItems).Email)});

UpdateContext({Escalation2: Office365Users.ManagerV2(Escalation1.mail)});

UpdateContext({Escalation3: Office365Users.ManagerV2(Escalation2.mail)})

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@AIUYM19 

You're most likely dealing with a timing issue...PowerApps is trying to evaluate the Formula you have all together and the initial Escalation1 is empty.

Try to break your formula out:

UpdateContext({Escalation1: Office365Users.ManagerV2(First(cmbCreateNewAssignee.SelectedItems).Email)});

UpdateContext({Escalation2: Office365Users.ManagerV2(Escalation1.mail)});

UpdateContext({Escalation3: Office365Users.ManagerV2(Escalation2.mail)})

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes Thanks, that seemed to do the trick! It was a combination of timing and I was using [Form].Unsaved, instead of [Form].Updates in a Patch() function later on in the control property.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,561)