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 Platform Community / Forums / Power Apps / Make parts of a list v...
Power Apps
Unanswered

Make parts of a list visible depending on specific buttons

(0) ShareShare
ReportReport
Posted on by 88

Dear community,

 

I'm Miguel and a starter in powerapps and coding.

 

I have a powerapp (see photo 1) and i want parts of the list to be visible depending on which button i click.

 

Now i have the button 1: UpdateContext({togglevalue1: !togglevalue1}) (see photo 2)
And the items from the list i want visible depending on button 1 If(togglevalue1;true;false)

 

Button 2 then : UpdateContext({togglevalue2: !togglevalue2}) (see photo 4 and 5)

And it's items: If(togglevalue2;true;false)

 

Is it possible, that if i click on button 2, i would only see the items linked with button 2 and all the other items their visibility goes off?

Can somebody help me with this?

 

With kind regards,

Miguel

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi

     

    I would suggest you replace the buttons at the top with a horizontal gallery. In on-start in you app run this
    ClearCollect(
    _MainButtons, //Or whatever you want to call it
    {ID:1,Title:"Werknemer"},

    {ID:2,Title:"Voorb.HR"},
    .....
    {ID:10;Title:"Afwerking"}
    )
    In the gallery use _MainButtons as data source.

    Add a button, and the name is ThisItem.Title. Adjust the gallery to fit the buttons.

    You can of course also use icons or other element as your menu items. 

     

    Also in your gallery, You can set the selected item to be another color by setting displayMode on button to If(ThisItem.IsSelected;DisplayMode.Disabled;DisplayMode.Edit). Then change det disable color, border, fill to what  you want.

     

    On the items below (Text input and/or icons) you could group them (with conainers, do not use groups) or set this code on visible on each controller:
    Switch(
    MainButtonGallery.Selected.ID;
    1,true,
    2,false,
    3,true,
    ...
    10,false
    )
    I dont know enough to say you should use containers or not, but when using the container, you can make 10 of them, each for every button and then set visible to Gallery.Selected.ID=1 on the first one =2 and so on. 

    This is a much more effective way than using update context with 10 variables you have to turn on an of. Its also easy to add a new button and As its a gallery with one button, it only count as 2 controllers instead of 10 (when it comes to optimising your app).

     

    I hope this helps

  • MiguelDeNeve Profile Picture
    88 on at

    Thank you Turbotape!

    Like u said, i made on 'app' function 'Onstart' the following:

    ClearCollect(
    _MainButtons;
    {ID:1;Title:"Werknemer"};
    {ID:2;Title:"Voorb. HR"};
    {ID:3;Title:"Voorb. IT"};
    {ID:4;Title:"Voorb. M"};
    {ID:5;Title:"Voorb. Ont."};
    {ID:6;Title:"Introductie"};
    {ID:7;Title:"Opvolg. HR"};
    {ID:8;Title:"Opvolg. Afd."};
    {ID:9;Title:"Opvolg. Opl."};
    {ID:10;Title:"Afwerking"};
    {ID:11;Title:"Toon alles"}
    )

     

    Then i went to my form, added a gallery and used '_mainbuttons' as source.

    And the text of the item i can select of the gallery ThisItem.Title

     

    After that i change the function 'visible' of each item on the form and typed:

    MainButtonGallery.Selected.ID=1 Or MainButtonGallery.Selected.ID=11

    I typed in every item extra the following 'Or MainButtonGallery.Selected.ID=11'

     

    ID=1 for the once i want to see if i click on the first button of the gallery and ID=11 if i want to see everything.

     

    It works because of your help.

    Thank you again 🙂

     

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