web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting variable to Us...
Power Apps
Unanswered

Setting variable to User().Email resulting in blank

(0) ShareShare
ReportReport
Posted on by 134

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.

LS579_1-1713460444174.png

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!

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    on at

    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.

    vyueyunmsft_0-1713490300702.png

     

    Best Regards,

    Yueyun Zhang

     

  • LS579 Profile Picture
    134 on at

    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard