web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Tabs - Show or...
Power Apps
Answered

Gallery Tabs - Show or Hide Tabs based on Field Value

(0) ShareShare
ReportReport
Posted on by 991
I have a list of Tabs using a Gallery and I would like to hide some of those tabs if a field value equals as certain value.  I want to hide the Subcontracting tabs based on a field in the form.  
 
Items = 
Table(
    {
        ID: 1,
        Label: "General Info"
    },
    {
        ID: 2,
        Label: "Contract Info"
    },
    {
        ID: 3,
        Label: "Prime Info"
    },
    {
        ID: 4,
        Label: "Gov't Info"
    },
    {
        ID: 5,
        Label: "T&C/Clause Info"
    },
    {
        ID: 6,
        Label: "Deliverable Info"
    },
    {
        ID: 7,
        Label: "Employee Info"
    },
    {
        ID: 8,
        Label: "Security Info"
    },
    {
        ID: 9,
        Label: "Billing/Invoices Info"
    },
    {
        ID: 10,
        Label: "Subcontracting Info"
    },
    {
        ID: 11,
        Label: "Subcontracting Details"
    },
    {
        ID: 12,
        Label: "Notes/Attachments"
    },
    {
        ID: 13,
        Label: "Signatures"
    }
)
Categories:
I have the same question (0)
  • Verified answer
    KeithAtherton Profile Picture
    3,707 Most Valuable Professional on at
    Hey. This approach looks good - you could add another field called "Visible" which checks the condition of interest (in my case, txtMyField.Text = "TEST") then use that field value for the gallery item button visible property:
    Table(
        {
            ID: 1,
            Label: "General Info",
            Visible:txtMyField.Text = "TEST"
        },
    // etc
     
  • RyanAutomates Profile Picture
    139 on at
    Hello,
     
    I haven't used a table inside a gallery before, but it sounds like you're almost trying to make a sort of dynamic menu? I think there might be a few approaches to what you would like to do:
     
    1) In the visible property of each control in your row, you can put an If condition for each row, or use a switch statement:
     
         If(ThisItem.ID = 3 && !examplebooleanfieldonyourform, false, true),
         If(ThisItem.ID = 4 && !anotherexamplebooleanfieldonyourform, false, true)
         
         Switch(
              True,
              Condition1, Result1,
              Condition2, Result2,
              Condition3, Result3,
              DefaultResult
    )
     
    This might not produce the UI requirements you are looking for however, as it may leave you with a row of empty space.
     
     
    2) The answer that's probably best is to dynamically filter out any row in your table by using a "Filter" operator with conditions on the end:
     
         Filter(
              Table(
                        { ID: 1, Label: "General Info" },
                        { ID: 2, Label: "Contract Info" },
                        { ID: 3, Label: "Prime Info" },
                        { ID: 4, Label: "Gov't Info" },
                        { ID: 5, Label: "T&C/Clause Info" },
                        { ID: 6, Label: "Deliverable Info" },
                        { ID: 7, Label: "Employee Info" },
                        { ID: 8, Label: "Security Info" },
                        { ID: 9, Label: "Billing/Invoices Info" },
                        { ID: 10, Label: "Subcontracting Info" },
                        { ID: 11, Label: "Subcontracting Details" },
                        { ID: 12, Label: "Notes/Attachments" },
                        { ID: 13, Label: "Signatures" }
              ),
              !(ID = 3 && !examplebooleanfieldonyourform) // Condition to exclude "Prime Info" row if examplebooleanfieldonyourform is false
    )
     
    I haven't tried this myself with a table, but I think it might make the options you don't want displayed to disappear.
     
     
    3) You could put containers inside the gallery for each row to dynamically toggle visibility of each container based on conditions. This would give you more granular control over every aspect but would require writing or copy pasting lots more Power Fx.
     
     
    Hope this helps! :)
  • kmw1130 Profile Picture
    991 on at
    @KeithAtherton,
    I added your suggestion on the Items:
    But it didn't seem to change when Sub wasn't selected.
     
    Did I not add it correctly?
  • Suggested answer
    KeithAtherton Profile Picture
    3,707 Most Valuable Professional on at
    That code looks good. Did you also set the gallery item control (I'm guessing button) Visible property to ThisItem.Visible?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 105 Most Valuable Professional

#2
Haque Profile Picture

Haque 77

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 70

Last 30 days Overall leaderboard