Hello!
In my standalone app, I have a dropdown that I only want visible to our team's groups. I have done this successfully for a button on another app using Microsoft Entra ID (Azure AD) and the CheckMembersGroupsV2 function. Since I was using the exact same groups, I just copy and pasted the formula from one app to my current app. The formula is set on the App's OnStart property as follows:
If(!IsEmpty(MicrosoftEntraID.CheckMemberGroupsV2(User().Email,["Group1 Object ID"]).value), Set(varGroup1, true), Set(varGroup1, false));
If(!IsEmpty(MicrosoftEntraID.CheckMemberGroupsV2(User().Email,["Group2 Object ID"]).value), Set(varGroup2, true), Set(varGroup2, false))
then I set the Visible property for the dropdown to "varGroup1 Or varGroup2". This made the dropdown invisible, so I checked to see if the variables were being set to my email and also to true, instead, all I see is blank.
I had previously achieved this functionality with the button with a different formula, so I also tried that one:
Set(varUserEmail,User().Email);Set(varGroup1,!IsBlank(MicrosoftEntraID.CheckMemberGroupsV2(varUserEmail,["Group1 Object ID"]))) Or Set(varGroup2,!IsBlank(MicrosoftEntraID.CheckMemberGroupsV2(varUserEmail,["Group2 Object ID"])))
and this one also comes up as blank for each variable.
Can anyone tell me why this is working for a button and not a dropdown? Or what I am doing wrong / another way to achieve this functionality?
TIA!
Oh my gosh! I completely forgot about that step!!! I can't believe it!
Thank you so much for answering my question even though it was such an oversight on my part!
Hi , @LS579
Where do you put this code in your Power App. If you put the code in the App- OnStart. You need to click "Run on start" to test.
Best Regards,
Yueyun Zhang
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional