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 / Making data card visib...
Power Apps
Answered

Making data card visible based on user profile

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to hide some data cards in my SharePoint form to everyone apart from 15 administrators. Based on other messages on this forum I have tried the below formulas but they don't seem to work for the users helping me test - they can still them despite not being a user mentioned in the formula. I have tried the following in the 'Visible' function bar:

 

(User().Email in ["user.name1@XXXX.com" Or "user.name2@XXXX.com" Or "user.name3@XXXX.com" Or "user.name4@XXXX.com"])

 

and

 

If(User().Email in ["user.name1@XXXX.com" Or "user.name2@XXXX.com" Or "user.name3@XXXX.com" Or "user.name4@XXXX.com"],true, false)

 

If I remove my own name from the above lists, I lose the visibility of the data card myself in the Power Apps studio view, which is why I'm a bit stuck as to why it's not working otherwise in the browser for my colleagues. I have tried asking them to refresh using f5, use another browser, incognito mode etc.

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Write this on:

    App.OnStart:

     

    Set(IsAdmin,varUser.Email in ["user.name1@XXXX.com","user.name2@XXXX.com","user.name3@XXXX.com","user.name4@XXXX.com"]);

     

    then on your datacard's visible property write:

    IsAdmin

  • Verified answer
    Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    If( User().Email = "user.name1@XXXX.com" OR  User().Email = "user.name2@XXXX.com", true, false)

    But my advice would be for you to use Azure AD or Office 365 Users.

    Like this:

    OnStart:

    ClearCollect(SharePointGroupMembersRH;GruposdoOffice365.ListGroupMembers("....").value)

     

    Visible of a button:

    If(IsBlank(LookUp(SharePointGroupMembersRH;mail = User().Email)) = true; false; true)



  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks all - I have tried the above but I am getting the below messages:

    Onstart:

    ClearCollect(SharePointGroupMembersRH;GruposdoOffice365.ListGroupMembers("UK-Meeting-Requests").value) (I'm assuming that the ... was the gap for the AD group)

    Error: Name isn't valid. This identifier isn't recognised.

     

    If( User().Email = "user.name1@XXXX.com" OR  User().Email = "user.name2@XXXX.com", true, false)

    Error: Incompatible types for comparison. These types cannot be compared: Boolean, text

     

    Onstart:

    Set(IsAdmin,varUser.Email in ["user.name1@XXXX.com","user.name2@XXXX.com","user.name3@XXXX.com","user.name4@XXXX.com"])

    Error: Name isn't valid. This identifier isn't recognised.

     

    I'm not sure what I'm doing wrong, unless my company is blocking it from pulling the user profile somehow (which I doubt because the 'Get User Profile' connector in MS Automate works).

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    This one might work:

     

    Write this on:

    App.OnStart:

     

    Set(IsAdmin,User().Email in ["user.name1@XXXX.com","user.name2@XXXX.com","user.name3@XXXX.com","user.name4@XXXX.com"]);

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard