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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,283)