Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 9aRQY0mNnoFoV0MGPj7yHm
Power Apps - Building Power Apps
Suggested answer

How to search multiple item (Char10)

Like (1) ShareShare
ReportReport
Posted on 14 Mar 2025 11:39:19 by 321
Hi All,
 
Im trying to see if its possible to search/filter through 4 SP list with a collection see example below
 
 
user entry 5 items in search box
 
ClearCollect(
    ColMultiItems,
    Split(
        TextInput2.Text,
        Char(10)
    )
);
 
 
With this collection i need to filter through 4 SP list
 
 
Combined SP list 
 
ClearCollect(
    ColNEgal,NETHAllocation
);
ClearCollect(
    ColNWgal, NWTHAllocation
   
);
ClearCollect(
    ColSEgal, SETHAllocation
);
ClearCollect(
    ColSWgal,
    SWTHAllocation
);
ClearCollect(colAllGallLoc,ColNEgal,ColNWgal,ColSEgal,ColSWgal);
 
Thank you 🙂
 
Categories:
  • moerah Profile Picture
    321 on 16 Mar 2025 at 13:15:40
    How to search multiple item (Char10)
    @KennyJ thank you for the reply,
     
    that was my first approach but failed miserably, I got stuck and couldn’t retrieve the values from apply to each  tried everything kept saying failed array, object etc... is their a blog or topic i can look for?
  • KennyJ Profile Picture
    162 on 16 Mar 2025 at 02:00:33
    How to search multiple item (Char10)
    I think you would actually be better to pass the search values to Power Automate which could then get the results from each SP list, join the data together and then pass you back the consolidated data you required to then store in you collection. 
  • moerah Profile Picture
    321 on 15 Mar 2025 at 20:24:08
    How to search multiple item (Char10)
     
    This is working for me see below, I know their must be a better way to do this 
     
    OverView:
     
    Process
     
    Step 1:
     
    User inputs search criteria in textinput 
     
    on select search button:
     
    ClearCollect(MyValues2, Split(TextInput2.Text, Char(10)));
    UpdateContext({TimerStartCol:true});
    UpdateContext({selfdisable:DisplayMode.Disabled})
    
    -------------------------------------------------------------------------------------------------
     
    step 2: (Hidden)
     
    stores in collection with row number (index)
     
    Gallery Item:
     
    With(
        { 
            RowCollection: MyValues2 // Ensure data is properly assigned
        },
        ForAll(
            Sequence(CountRows(RowCollection)), 
            Patch(
                Last(FirstN(RowCollection, Value)), 
                { rowIDNumber: Value } 
            )
        )
    )
    ----------------------------------------------------------------------------------------------------
    Step 3: (Hidden)
     
    Look up gallery row number for each individual text label
     
    Text Label1:
    LookUp(MultiNHnumber.AllItems, rowIDNumber = 1).Value
    Text Label 2:
    LookUp(MultiNHnumber.AllItems, rowIDNumber = 2).Value
    etc etc.....
     
    side note(i want to avoid this or else have to create many labels)
    --------------------------------------------------------------------------------------------------
    Step 4 (Hidden)
     
    Filter datasource based off step 3
     
    SP list 1 
     
    gallery Item:
     
    Filter(
        NETHAllocation,
        StartsWith(NHSnumber, Coalesce(NHnum1.Text)) ||
        StartsWith(NHSnumber, Coalesce(NHnum2.Text)) ||
        StartsWith(NHSnumber, Coalesce(NHnum3.Text))
    )
    
     
    SP List 2
     
    gallery item
     
    Filter(
        SWTHAllocation,
        StartsWith(NHSnumber, Coalesce(NHnum1.Text)) ||
        StartsWith(NHSnumber, Coalesce(NHnum2.Text)) ||
        StartsWith(NHSnumber, Coalesce(NHnum3.Text))
    )
    
    
    etc etc.......
     
    ------------------------------------------------------------------------------------------------
     
    Side Step: (Hidden)
     
    Timer End:
     
        ClearCollect(colNEgallery, Gallery9.AllItems);
        ClearCollect(colSWgallery, Gallery9_1.AllItems);
    ClearCollect(colAllGallery, colNEgallery, colSWgallery);
     
    -------------------------------------------------------------------------------------------------
     
    Result
     
    gallery Item:
     
    colAllGallery
     
    Thank you 😊
     
     
     
  • Suggested answer
    Jacqui Muller Profile Picture
    57 on 15 Mar 2025 at 15:58:14
    How to search multiple item (Char10)
    Ohhhhhhh I see what you mean @moerah! The best option then might be to follow the join logic. So join the two collections using a group by.
     
    // Filter
    ClearCollect(
        colFilteredResults,
        Filter(
            colAllGallLoc,
            Title in ColMultiItems.Value // Assuming "Title" is the column you're searching in
        )
    );
     
    // Group by
    ClearCollect(
        colGroupedResults,
        GroupBy(
            colFilteredResults,
            "Source", // Change this if you want to group by another column
            "GroupedItems"
        )
    );
     
  • moerah Profile Picture
    321 on 14 Mar 2025 at 14:17:44
    How to search multiple item (Char10)
    @Jacqui Muller Thank you for the reply 
     
    Yes, will need to use the large collection as it has all four locality 
     
    i just dont know how to filter with multiple item i can do it with one item and use startswith function to search cant do it for multiple hope that makes sense
     
    thank you 😊
  • Jacqui Muller Profile Picture
    57 on 14 Mar 2025 at 13:16:05
    How to search multiple item (Char10)
     
    I hope you are well.
     
    Do you need to know which list it is from? Is it possible to use the large collection and search from there? 
     

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,474 Most Valuable Professional

Leaderboard
Loading started