Skip to main content

Notifications

Community site session details

Community site session details

Session Id : AglqKAvN/gnfoIqEKFBKAB
Power Apps - Building Power Apps
Answered

Filter Vertical Gallery with button press on another screen

Like (0) ShareShare
ReportReport
Posted on 6 May 2022 18:54:29 by 134

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.

  • ChrisS81 Profile Picture
    134 on 08 May 2022 at 16:47:49
    Re: Filter Vertical Gallery with button press on another screen

    Thanks @Drrickryp 

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on 07 May 2022 at 15:27:31
    Re: Filter Vertical Gallery with button press on another screen

    @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 Profile Picture
    134 on 06 May 2022 at 22:41:07
    Re: Filter Vertical Gallery with button press on another screen

    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.

     

  • slerch Profile Picture
    59 on 06 May 2022 at 19:17:53
    Re: Filter Vertical Gallery with button press on another screen

    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.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started