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 / Searching a Gallery th...
Power Apps
Unanswered

Searching a Gallery that is a Collection (Only get Result as Field Option)

(0) ShareShare
ReportReport
Posted on by

I have a collection called "MergedContacts". I then create another collection called "FilteredContacts" which filters the "MergedContacts" collection. I want the ability to search the "FilteredContacts" with a text input. However, when I input the search formula the only field option I get is "Result". 

 

Any assistance is greatly appreciated.

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @PoohBear ,

    What is the Collect code you use to get FilteredContacts and what is the Search code you are using to try to find items?

  • eka24 Profile Picture
    20,925 on at

    Can you give a screen shot. are using Distinct formula?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • PoohBear Profile Picture
    on at

    Here are the collect codes

     

    ClearCollect(MergedContacts,ExecutivesImportMergedContacts.Run());
    ClearCollect(FilterContacts,Distinct(SortByColumns(Filter(MergedContacts,
    ceo_ind="1"&&cntc_sts_cd="ACT"||ceo_ind="3"&&cntc_sts_cd="ACT"||
    ceo_ind=" "&&cntc_titl_nm="Vice President & General Manager"||
    ceo_ind=" "&&cntc_titl_nm="Chief Strategy Officer"&&cntc_lst_nm="Walker"||
    ceo_ind=" "&&cntc_titl_nm="Senior VP & CBUO"||
    cntc_titl_nm="President & CEO"&&clb_cd="602"
    ),"clb_cd",Ascending),tgt_prtcp_id))

     

    Search code

    If(IsBlank(SearchInput.Text),FilterContacts,Search(FilterContacts,SearchInput.Text,"Result")) The only field option is "Result". 

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @PoohBear ,

    I have parsed it below for ease of reference

    ClearCollect(
     MergedContacts,
     ExecutivesImportMergedContacts.Run()
    );
    ClearCollect(
     FilterContacts,
     Distinct(
     SortByColumns(
     Filter(
     MergedContacts,
     ceo_ind="1"&&
     cntc_sts_cd="ACT"||
     ceo_ind="3"&&cntc_sts_cd="ACT"||
     ceo_ind=" "&&
     cntc_titl_nm="Vice President & General Manager"||
     ceo_ind=" "&&
     cntc_titl_nm="Chief Strategy Officer"&&
     cntc_lst_nm="Walker"||
     ceo_ind=" "&&
     cntc_titl_nm="Senior VP & CBUO"||
     cntc_titl_nm="President & 
     CEO"&&clb_cd="602"
     ),
     "clb_cd",
     Ascending
     ),
     tgt_prtcp_id
     )
    )
    If(
     IsBlank(SearchInput.Text),
     FilterContacts,
     Search(
     FilterContacts,
     SearchInput.Text,"Result"
     )
    ) 

    The reason is simple - you have wrapped the entire collection in a Distinct filter - the only output this will produce is Result.

    Get rid of it and see what the search (which is quite valid) then produces.

     

    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.

     

  • PoohBear Profile Picture
    on at

    Your code is not working but I appreciate you pointing out that "Distinct" is causing the issue. Now that I understand the cause I can work around it. 

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @PoohBear ,

    It is not my code - it is yours - I simply parsed it so I could see the structure better (I did not change anything).

    The other thing you need to look at is the mixture and And() && and Or() || - you will need some brackets in the right places or you will not get the results you need.

     

    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.

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @PoohBear ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard