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 / Search by a column hav...
Power Apps
Answered

Search by a column having multiple values

(1) ShareShare
ReportReport
Posted on by 14

I have a PowerApps application for which the backend source is SharePoint. I have a requirement where I need to search by the table tables. So, I used the formula -

Sort(Filter(
Table_name, inputSearch_3.Text in ColumnA
|| inputSearch_3.Text in ColumnB
)
,ColumnA,SortOrder.Ascending)

 

Now I got a new requirement where I need to search by another column too but that column columnC has multiple values which is the lookup for another table (Table_name1, column ColumnD) having single values.

 

Can you please modify the above query and provide me a query which can search by columnC also.

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @BharathSena - you can try the non-delegable method below:

     

     

    Sort(
     Search(
     AddColumns(
     Table_name,
     "MyMultiChoiceLookUp",
     Concat(
     'Your multi-choice lookup field',
     Value & ","
     )
     ),
     inputSearch_3.Text,
     "ColumnA",
     "ColumnB",
     "MyMultiChoiceLookUp"
     ),
     ColumnA,
     SortOrder.Ascending
    )

     

     

  • BharathSena Profile Picture
    14 on at

    Thanks but where did you use columnC, second table Tablename2 and its column columnD?

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @BharathSena - replace "Your multi choice lookup field" in the above code with the name of Column C.

  • BharathSena Profile Picture
    14 on at

    Thanks can you please tell what is "myMultichoiceLookup" and value

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @BharathSena - it is not possible to use the Search or In function on complex field types (such as Choice, Lookup, People).

     

    Instead we use the AddColumns function to bring a "Virtual" column into our table. An equivalent of this is using a Vlookup in Excel - you're bringing in a new column with data that does not actually exist at source.

     

    In this example, we have created a column called "MyMultiChoiceLookUp" which returns the data from your multi-choice lookup column in text format.

     

    We then run a Search against this column to return the results we need.

     

    Note that "MyMultiChoiceLookUp" is entirely made up name, and it can be anything you want.

     

    Also note that using the AddColumns function this will modify your Gallery schema, and could impact any variables you might be running against the Gallery.

     

    Further reading:

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-table-shaping 

     

  • BharathSena Profile Picture
    14 on at

    Thank you so much

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard