Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
 View Only
  • 1.  Converting a Gallery Filter() to a Search that includes static values

    Posted Feb 23, 2023 03:00 PM

    Good day,

    I have a Gallery I'm using that includes a Filter that reduces a Dataverse table's found set to just the records that have a "Yes" in a Yes/No column:

    Items - Filter(z_AGENCIES, 'TOP_LEVEL' = 'TOP_LEVEL (z_AGENCIES)'.Yes)

    It works fine, but the resulting data list is still over 300 records long, so I would like to further narrow the results using the search function that incorporates a search input text box AND the static "Yes" choice against the TOP_LEVEL column.  This search works:

    SortByColumns(

        Search(z_AGENCIES,AgencySearchTextInput_2.Text,"cr951_agency", "cr951_subagency", "cr951_agency_acronym", "cr951_subagency_acronym"),

        "cr951_subagency")

    How would I incorporate the Yes/No selection into the Search function?



    ------------------------------
    Rik Forgo
    Writer/Editor
    ------------------------------


  • 2.  RE: Converting a Gallery Filter() to a Search that includes static values

    Bronze Contributor
    Posted Feb 24, 2023 02:10 AM

    Hi Rik,

    you may try to replace z_AGENCIES in

    SortByColumns(Search(z_AGENCIES,....

    with your complete working FILTER(..) statement. It provides a table, that is needed as 1st parameter for the Search function.

    stefan



    ------------------------------
    Stefan Sauerländer
    Business Analyst
    Ratingen
    ------------------------------



  • 3.  RE: Converting a Gallery Filter() to a Search that includes static values

    Posted Feb 24, 2023 11:04 AM

    Thank you, Stefan, that worked perfectly. And for other newbies like me, this is what the final result looked like:

    SortByColumns(

        Search(Filter(z_AGENCIES, 'TOP_LEVEL' = 'TOP_LEVEL (z_AGENCIES)'.Yes),AgencySearchTextInput_2.Text,"cr951_agency", "cr951_subagency", "cr951_agency_acronym", "cr951_subagency_acronym"),

        "cr951_subagency")



    ------------------------------
    Rik Forgo
    Writer/Editor
    ------------------------------