Skip to main content

Notifications

Community site session details

Community site session details

Session Id : J+eXJN5x7IfdtSR0aYGzY8
Power Apps - Building Power Apps
Unanswered

Filter Gallery by Entering Multiple Values for Same Column

Like (1) ShareShare
ReportReport
Posted on 22 Jul 2024 16:53:58 by 69
I have an app with a gallery that is filtered with a Starts with that allows the user to enter a the reservation number and all the items in the gallery with that reservation number show in the gallery. From there the user can interact with the items in a number of ways, one of which is to export all the items shown in the gallery to a csv file. (This is basically an "order" and the gallery shows all the items ordered, so each reservation number can have multiple items associated with it.)
My users will be printing labels for all the items they have "pulled" for the customer orders. Sometimes they will create labels for several small orders at one "sitting." The way my app works now, they must export then print the labels one reservation at a time. What I would like to do is make a way for the user to interact with several reservations and them export all the items they worked on to csv at the same time. I thought perhaps they could just enter two or three reservation numbers into the textbox (separated by commas, maybe?) and all of the items associated with the entered numbers would show up in the gallery. However, I haven't been able to find any instructions for that so I'm guessing it isn't possible.
Everything I've seen out there seems to be how to filter using multiple conditions in different column, etc. I am looking for a way to filter for multiple values in the same column - in this case a text column. I am open to any suggestions. Is there a way to make radio boxes with all the unique values in the Reservation number column (which is a text column)?  What is the best way to accomplish this?
I would appreciate any guidance!
 
Categories:
  • CTASS Profile Picture
    69 on 24 Jul 2024 at 19:44:26
    Filter Gallery by Entering Multiple Values for Same Column
    SoPatt,
    Thanks for your response! The filter you suggested worked for me as far as searching for more than one value. The statement I used is:
     
    Filter(Tickets4Labels, RESERVE in Split(SearchInput1.Text," ")) 
     
    Now, however, I have a problem reaching my ultimate goal, in that I have an "EXPORT" button set up to run a flow that exports whats in the gallery to a CSV file. This is the "On Success" formula:
     
    ClearCollect(colChildRec,Items4Labels);
    ClearCollect(colExportChild,ShowColumns(Filter(colChildRec,'PARENTID: RESERVE'.Value = SearchInput1.Text),'PARENTID: RESERVE','PARENTID: OUTDATE','PARENTID: JOBNAME','PARENTID: PRINTNAME','PARENTID: NAME','PARENTID: TOTALLABEL',PARENTID,QTYLABELS,CONTAINER,QTYPER,MEMO,'PARENTID: INITIALS'));
    Concurrent(
        Notify("Working on it...",NotificationType.Information),
       Set(csvFileUrl, TicketsandItemsCSV.Run(JSON(colExportChild,JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes)).fileurl
    ));
    Launch(csvFileUrl)
    As you can see, the second ClearCollect statement is looking for the Value (singular) in the SearchInput1 box. Can you think of a way to make it able to read all the values in the box?
     
    Thanks for your help so far!! 
     
     
  • SoPatt Profile Picture
    Microsoft Employee on 23 Jul 2024 at 03:12:42
    Filter Gallery by Entering Multiple Values for Same Column
    I created the below collection:
    Collect(KeyValuePairs,
        {
            Key: "Key1",
            Value: "Value1_1"
        },
        {
            Key: "Key1",
            Value: "Value1_2"
        },
        {
            Key: "Key2",
            Value: "Value2_1"
        },
        {
            Key: "Key2",
            Value: "Value2_2"
        },
        {
            Key: "Key3",
            Value: "Value3_1"
        },
        {
            Key: "Key3",
            Value: "Value3_2"
        },    
        {
            Key: "Key4",
            Value: "Value4_1"
        },
        {
            Key: "Key4",
            Value: "Value4_2"
        }
    )

    I created two vertical galleries as shown below:
    The left gallery (Gallery3) has a checkbox (CheckBoxCanvas1) and the label on the checkbox is set to "ThisItem.Value" and Items is set to "Distinct(KeyValuePairs,Key)"
     
    The right gallery has a couple labels just to display items in the collection and Items is set to "Filter(KeyValuePairs,Key in Filter(Gallery3.AllItems,CheckboxCanvas1.Checked).Value)".

    You could also do the comma-separated text field (call it TextCanvas2) thing that you mentioned by setting the gallery items to: "Filter(KeyValuePairs,Key in Split(TextCanvas2.Text,","))"

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 > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 20

#2
BCBuizer Profile Picture

BCBuizer 10 Super User 2025 Season 1

#2
LC-26081402-0 Profile Picture

LC-26081402-0 10

Overall leaderboard
Loading started