Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Make button not clickable as well as not visible

(1) ShareShare
ReportReport
Posted on by 34

I'm very new to PowerApps and I'd inherited an App which has an component at the bottom of a screen.

 

In this component are selectable icons but one of which should be only available to the Admins (via a Sharepoint List).

 

Within the component > Data > Items there is this code:

 

 

 

Table(
 {
 Name: "Home",
 Icon: Icon.DetailList,
 Page: Dashboard, 
 Visible:true
 },
 {
 Name: "Bookings",
 Icon: Icon.Person,
 Page: MyAppts,
 Visible:true
 },
 {
 Name: "Book",
 Icon: Icon.Add,
 Page: NewBooking,
 Visible:true
 },
 {
 Name: "Manage",
 Icon: Icon.ComputerDesktop,
 Page: ManageDesks,
 Visible: varAdmin
 }
)

 

 

 

The bottom bit hides the icon but is still clickable - how do you disable that as well so it can't be selected?

Categories:
  • Verified answer
    rockshah Profile Picture
    rockshah 34 on at
    Re: Make button not clickable as well as not visible

    @M_Ali_SZ365  and @timl I think I've got a workaround for this which looks to have worked

    I've done this for that particular icon:

    Name: "Manage",
    Icon: Icon.ComputerDesktop,
    Page: If(varAdmin,ManageDesks, Dashboard),
    Visible: varAdmin

     

    I appreciate the assistance from both of you which then gave me the light bulb moment!

     

    Separate note: it shouldn't be like this there something is hidden it shouldn't be clickable! Anyway thanks again!

  • timl Profile Picture
    timl 34,403 on at
    Re: Make button not clickable as well as not visible

    @rockshah 

    Can you locate the gallery control in your component and find the formula that contains the call to Navigate?

    Once you do that, can you post the formula?

    The ultimate solution is to modify this formula so that it conditionally checks the visible property and to not navigate if the value of the visible property is false.

     

  • rockshah Profile Picture
    rockshah 34 on at
    Re: Make button not clickable as well as not visible

    @timl yes that is correct. I'm clicking on the 'empty' space where the icon would have been.

  • timl Profile Picture
    timl 34,403 on at
    Re: Make button not clickable as well as not visible

    Hi @rockshah 

    Just to clarify my understanding of this, you have a menu component that displays 4 icons - Home, Bookings, Book, Manage. Is there a gallery control in the component that displays this?

    What I don't quite understand is, if the component correctly hides the Manage icon, what exactly are you clicking on? Is it the empty space where the  icon would have appeared?

     

     

     

  • M_Ali_SZ365 Profile Picture
    M_Ali_SZ365 1,110 on at
    Re: Make button not clickable as well as not visible

    @rockshah ,

    Select the icon And go to the Advance property and search the DisplayMode And write this code 

    If(varAdmin, DisplayMode.Edit, DisplayMode.Disabled)

    M_Ali_SZ365_0-1701184213343.png

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali

     

     

  • rockshah Profile Picture
    rockshah 34 on at
    Re: Make button not clickable as well as not visible

    @M_Ali_SZ365 I didn't see DefaultMode or DisplayMode as an option within the dropdown box in the top left area.


    Anyway I've amended it as per your instructions but unfortunately that didn't work. It's still clickable even though icon is hidden.

    Any ideas?

  • M_Ali_SZ365 Profile Picture
    M_Ali_SZ365 1,110 on at
    Re: Make button not clickable as well as not visible

    @rockshah ,

    Try This

    Table(
     {
     Name: "Home",
     Icon: Icon.DetailList,
     Page: Dashboard, 
     Visible: true,
     DisplayMode: DisplayMode.Edit
     },
     {
     Name: "Bookings",
     Icon: Icon.Person,
     Page: MyAppts,
     Visible: true,
     DisplayMode: DisplayMode.Edit
     },
     {
     Name: "Book",
     Icon: Icon.Add,
     Page: NewBooking,
     Visible: true,
     DisplayMode: DisplayMode.Edit
     },
     {
     Name: "Manage",
     Icon: Icon.ComputerDesktop,
     Page: ManageDesks,
     Visible: varAdmin,
     DisplayMode: If(varAdmin, DisplayMode.Edit, DisplayMode.Disabled)
     }
    )

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali

  • rockshah Profile Picture
    rockshah 34 on at
    Re: Make button not clickable as well as not visible

    Hi @M_Ali_SZ365 thanks for your response. I've only been looking at PowerApps for a day so you might have to be patient with my questions.

     

    Where is the DisplayMode property?

    varAdmin has been set as boolean within OnStart

  • M_Ali_SZ365 Profile Picture
    M_Ali_SZ365 1,110 on at
    Re: Make button not clickable as well as not visible

    Hi @rockshah ,

    To make the "Manage" icon not clickable and not visible for non-admins, set the Visible property to varAdmin and use the same variable to conditionally set the DisplayMode property:

    If(varAdmin, DisplayMode.Edit, DisplayMode.View)

    For the "Manage" item in your table, ensure that varAdmin is a boolean that is true only for admin users. If varAdmin is false, the icon will be neither visible nor clickable.

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard