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.
Solved! Go to Solution.
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.
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.
@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.
User | Count |
---|---|
167 | |
90 | |
73 | |
64 | |
58 |
User | Count |
---|---|
215 | |
153 | |
97 | |
88 | |
66 |