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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to search multiple...
Power Apps
Unanswered

How to search multiple item (Char10)

(1) ShareShare
ReportReport
Posted on by 327
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:
I have the same question (0)
  • Jacqui Muller Profile Picture
    64 on at
     
    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? 
     
  • moerah Profile Picture
    327 on at
    @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 😊
  • Suggested answer
    Jacqui Muller Profile Picture
    64 on at
    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
    327 on at
     
    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 😊
     
     
     
  • KennyJ Profile Picture
    168 on at
    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
    327 on at
    @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?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard