Hello all,
I am using this formula:
If(roleCart.Text = "Manager" And ForWho.Selected.Value = "For a member of my team",
First(Filter(Office365Users.DirectReportsV2( Office365Users.MyProfileV2().userPrincipalName ).value, displayName = UserName.Text)).userPrincipalName)
where rolecart is a label and forwho is a dropdown.... but its not working completely... it gives me following error (invalid value for parameter ID), but it still returns the UPN...
I noticed that if i exclude the "And ForWho.Selected.Value = "For a member of my team" ", it will work without any error:
If(roleCart.Text = "Manager",
First(Filter(Office365Users.DirectReportsV2( Office365Users.MyProfileV2().userPrincipalName ).value, displayName = UserName.Text)).userPrincipalName)
Has anyone any idea what sorcery this is?
Solved! Go to Solution.
Give this a shot:
If(roleCart.Text = "Manager" && ForWho.Selected.Value = "For a member of my team",
With({_user:User().Email)},
LookUp(Office365Users.DirectReportsV2(_user).value,
displayName = UserName.Text,
userPrincipalName
)
)
)
Please consider changing your Formula to the following:
If(roleCart.Text = "Manager" && ForWho.Selected.Value = "For a member of my team",
LookUp(Office365Users.DirectReportsV2(Office365Users.MyProfileV2().userPrincipalName ).value,
displayName = UserName.Text,
userPrincipalName
)
)
I hope this is helpful for you.
unfortunately still the same
"Office365Users.DirectReportsV2 failed: The method 'DirectReportsV2' has an invalid value for parameter 'id'"
Give this a shot:
If(roleCart.Text = "Manager" && ForWho.Selected.Value = "For a member of my team",
With({_user:User().Email)},
LookUp(Office365Users.DirectReportsV2(_user).value,
displayName = UserName.Text,
userPrincipalName
)
)
)
well well well, someone was really good here, this one worked... can you explain why ? just so i dont ask the same question in different scenario again...
Also I think the issue why this would not run could be related to the fact that the "ForWho" is on a different screen...
When i placed the label with the same formula in the same screen it was working, but i could not work out how to transport the value to the different screen, even variable was not working although if i let a label display the variable it worked... just not in my formula (not even if i let my formula read the label)
No, controls are global in the app. You can access their values from any screen in the app - skip the variables, they are duplicate and unnecessary .
In this formula I provided, we did two things:
1) We skipped using the Office365Users.MyProfileV2() and went with the User email address, which is really all you need.
2) We took the above email and put that in a Scoped With variable. Sometimes putting the function directly into another function like that will cause bad results. I see it only on a couple of different connector actions. This one seems temperamental.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
195 | |
45 | |
45 | |
39 | |
35 |
User | Count |
---|---|
269 | |
83 | |
81 | |
73 | |
70 |