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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter gallery items o...
Power Apps
Unanswered

Filter gallery items on 2 variables

(0) ShareShare
ReportReport
Posted on by 26

I'm not sure if this is possible. But looking for help on Filtering a gallery on 2 variables. I've created a gallery with a excel feel. I can navigate and update records fine on the next gallery with no problems. The issue is trying to create a new record and displaying a default patch record in the next screen(gallery)? My gallery Items are set to sort(Filter(Datasource, ID=varible1), Ascending). 

 

Global Varible 1 is an item Onselect from screen1 moving to an editable excel like experience in screen 2. Ideally I would like to onselect of a + patch a default record, then navigate to the next gallery. If that makes sense?

Categories:
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @MP_Squared 

     

    We can use just the gallery itself like an excel and keep adding rows and Patch all together or only the changed items

    • Onvisible of the screen ClearCollect(ColName, SPList)
    • Set Items property of Gallery to ColName
    • Insert 2 icons (Add/Plus and Save)
    • Set Add cion Onselect property to Collect(ColData,{})
    • Set OnSelect property of Save icon to 

     

    ClearCollect(
     TempCollection,
     RenameColumns(
     BrowseGallerySave.AllItems,
     "ID",
     "newID"
     )
    );
    ForAll(
     TempCollection,
     Patch(
     SPList,
     LookUp(
     SPList,
     ID = newID
     ),
     {Title: TextInput1.Text}
     )
    )

     

     

    Example:

    StalinPonnusamy_0-1631564472800.png

     

     

     

  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @MP_Squared ,

    When you patch the new record, you need to set the ID to the Variable

    Set(
     variable1,
     Patch(
     datasource,
     . . . .. 
     ).ID
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • MP_Squared Profile Picture
    26 on at

    Thanks for the fast response WarrenBelz, I get the below trying the formula. Also this the 2second screenshot is the onselect for navigating an existing item to the next gallery. Thanks for the help! 

     

    2021-09-13_17-04-10.png

    screenshot2screenshot2

  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    @MP_Squared ,

    Can you please post your code in Text - change the reference names if you must, but I cannot get much out of blurred out small images.

  • MP_Squared Profile Picture
    26 on at

    @WarrenBelz , Sure no problem. The datasource is a sql database. The onselect property on the + is set to Set(varProduct, Patch('datasource', Defaults('datasource'), {PRODUCT_ID: "data"}); Navigate(GPL_Details, None, {SelectedItem: LookUp('Datasource', PRODUCT_ID = ThisRecord)})

    I'm stuck on navigating to the newly created record on gallery2 once its as well. 

    Onselect property for an existing record and navigating to gallery2 works fine. It is Select(Parent); Set(varProduct, Gallery2_1.Selected.PRODUCT_ID); Navigate(Details, Transition.None, {SelectedItem: LookUp('Datasource', PRODUCT_ID = varProduct)});

     

    Gallery2 Items are currently set to

    Sort(Filter('Datasource', PRODUCT_ID = varProduct), PRODUCT_PLATFORM, Ascending)

     

     

  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @MP_Squared ,

    I tend to do it this way - assuming PRODUCT_ID is a unique identifier

    Set(
     varProduct, 
     Patch(
     'datasource', 
     Defaults('datasource'), 
     {PRODUCT_ID: "data"}
     ).PRODUCT_ID
    ); 
    Navigate(
     GPL_Details, 
     None, 
     {
     SelectedItem: 
     LookUp(
     'Datasource', 
     PRODUCT_ID = varProduct
     )
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard