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

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:
I have the same question (0)
  • 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

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard