cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TomasG
Advocate II
Advocate II

How to make dynamic view browse gallery (columns)?

Hi, 

could anybody give me some advices, how could I make dynamic view browse gallery?

What I imagine under dynamic browse gallery (columns). I need to make sure that based on the user's application selection (which columns the user wants to see in the gallery), those columns will be displayed to him.


Example:
I have an SP list that contains column A, column B, column C, column D.
somewhere on the screen, will be e.g. ComboBox or Check box (I don't care). Based on the user's choice to view column A and column D. These columns will appear in the browse gallery.

Have anybody experience with this? Could give me any advice to solve this problem? 
Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
EdViegas
Resolver IV
Resolver IV

  1. Add horizontal container
  2. Add 4 labels (A, B, C, D) as column headers inside the horizontal container. Enable flexible width to each one.
  3. Configure visible property to each label to show/hide as You prefer
  4. Add Gallery control below horizontal container
  5. Add Labels or other controls inside the Gallery to each column and configure X, Width and Visible matching with the corresponding Label in the Horizontal Container

If You hide a Label in the horizontal container, the total width will be automatically occupied width visible elements and the controls inside the Gallery will positioned the same as the "columns" are. 

 

To manage visibily, You can use a Combobox with property items: 

 

Table(
    {Col: "A"},
    {Col: "B"},
    {Col: "C"},
    {Col: "D"}
)

 

Then, configure property visibility of each column header (labels inside the horizontal container) as:

 

If(
    CountRows(
        Filter(
            ComboBox.SelectedItems,
            Col = Self.Text
        )
    ) > 0,
    true,
    false
)

View solution in original post

3 REPLIES 3
fuzzy_fuzz
Resolver II
Resolver II

In the label where you want to display the column info put a switch function.

 

Switch(
    ComboBox1.Selected.Value;
    "Column1";
    ThisItem.Column1;
    "Column2";
    ThisItem.Column2
)

 Note that depending on the type of column you might need to add a ThisItem.ColumnX.Value to access the data.

EdViegas
Resolver IV
Resolver IV

  1. Add horizontal container
  2. Add 4 labels (A, B, C, D) as column headers inside the horizontal container. Enable flexible width to each one.
  3. Configure visible property to each label to show/hide as You prefer
  4. Add Gallery control below horizontal container
  5. Add Labels or other controls inside the Gallery to each column and configure X, Width and Visible matching with the corresponding Label in the Horizontal Container

If You hide a Label in the horizontal container, the total width will be automatically occupied width visible elements and the controls inside the Gallery will positioned the same as the "columns" are. 

 

To manage visibily, You can use a Combobox with property items: 

 

Table(
    {Col: "A"},
    {Col: "B"},
    {Col: "C"},
    {Col: "D"}
)

 

Then, configure property visibility of each column header (labels inside the horizontal container) as:

 

If(
    CountRows(
        Filter(
            ComboBox.SelectedItems,
            Col = Self.Text
        )
    ) > 0,
    true,
    false
)

Thank you @EdViegas , this is the right way! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,735)