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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard