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 Apps
Answered

DisplayMode Bug?

(0) ShareShare
ReportReport
Posted on by 48

Hi,

 

I want to disable the button according to user name of currently logged-in user.

I'm using this formula: 

If(Office365Users.MyProfile().DisplayName = "name1" || "name2" || "name3" || "name4", DisplayMode.Edit, DisplayMode.Disabled)

 

Syntax of my formula seems to be o.k. (at least shows no errors), but it always work only for first user in my formula. When I put "name1" into the end of formula like:

If(Office365Users.MyProfile().DisplayName = "name2" || "name3" || "name4" || "name1", DisplayMode.Edit, DisplayMode.Disabled)

 

...then it works only for "name2". 

Names 1, 3 and 4 see the button in Disabled mode.

 

I've tried with User().FullName too, but same results.

 

Do I have something wrong in my formula?

Can someone help me?

 

Thanks!

Categories:
  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Lubeno78 

    Please try the following,

    If(Office365Users.MyProfile().DisplayName in ["name1", "name2", "name3", "name4"], DisplayMode.Edit, DisplayMode.Disabled)

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • CU29100747-0 Profile Picture
    48 on at

    @CNT : Thank you very much !! This works great !

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Lubeno78 

    Glad to help!

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard