cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChrisS81
Helper II
Helper II

Filter Vertical Gallery with button press on another screen

Hello,

 

I'm new to power apps and need a little help.

 

I have a SharePoint list that has a list of objectives. The objectives are stored in the list as:

 

Title       Objective Title

1.1         Objective Name 1.1

1.2         Objective Name 1.2

1.3         Objective Name 1.3

2.1         etc.

2.2

2.3

etc.

 

I have the list connected to a vertical gallery on one of my screens. On the main page I need to be able to press a button called "Objective 1" that takes me to the next screen. When I get to the next screen I would like to see only the items associated with objective 1 from my list to display in the vertical gallery.

 

I've seen posts about needing to create a variable but haven't had any luck getting it to work. Any help would be greatly appreciated. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@ChrisS81 

Use a variable to control the Items property of the data table on a target screen like scrDatatable.

For example in button 1:Set(itms, Filter(splist, Topic=1) ;Navigate(scrDatatable)

for button 2: Set(itms, Filter(splist, Topic=2); Navigate(scrDatatable),  etc. 

For an unfiltered list, you could have a button "Unfiltered": Set(itms, splist); Navigate(scrDatatable)
Make the Items property of the data table: Sort(itms, Title, Ascending)

 

View solution in original post

4 REPLIES 4
slerch
Helper I
Helper I

I'll make a couple assumptions and you can correct me if I'm wrong. You need a button for each OBjectiveand 1.1, 1.2, 1.3, ..., 1.n are a subset of Objective 1.

 

I would have a second gallery that where the items are:

Distinct(
    SpListName,
    First(
        Split(
            Title,
            "."
        )
    ).Result
)

This will give you the distinct values that are before the "." in Title.

 

Then have button in the gallery has the OnSelect value of:

Set(numObjective, ThisItem.Result);

 

On the next page the Vertical Gallery will have the items:

Filter(
    SpListName,
    First(
        Split(
            Title,
            "."
        )
    ).Result = numObjective
)

This should give you the items that you're after.

 

That being said, I would personally set this up with 2 SharePoint Lists. The first one is Objectives and the second one would be the sub-objectives.

Thanks for the reply @slerch .

 

My example above for the Objective Title isn't how it's displayed in my list. I should've been more clear. Sorry about that.

 

The list is more like:

 

Topic  Title       Objective Title

1         1.1         Objective Name 1.1

1         1.2         Objective Name 1.2

1         1.3         Objective Name 1.3

2         2.1         etc.

2        2.2

2        2.3

 

I need to filter so that if I click on the "Topic 1" button, it filters the gallery on the next page to display:

Topic  Title       Objective Title

1         1.1         Objective Name 1.1

1         1.2         Objective Name 1.2

1         1.3         Objective Name 1.3

 

Hopefully this clarifies what I'm trying to do.

 

Drrickryp
Super User
Super User

@ChrisS81 

Use a variable to control the Items property of the data table on a target screen like scrDatatable.

For example in button 1:Set(itms, Filter(splist, Topic=1) ;Navigate(scrDatatable)

for button 2: Set(itms, Filter(splist, Topic=2); Navigate(scrDatatable),  etc. 

For an unfiltered list, you could have a button "Unfiltered": Set(itms, splist); Navigate(scrDatatable)
Make the Items property of the data table: Sort(itms, Title, Ascending)

 

ChrisS81
Helper II
Helper II

Thanks @Drrickryp 

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 (3,546)