Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: DisplayMode Bug?

    @Lubeno78 

    Glad to help!

  • CU29100747-0 Profile Picture
    48 on at
    Re: DisplayMode Bug?

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

  • Verified answer
    CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: DisplayMode Bug?

    @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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard