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 / Search says "Wrong col...
Power Apps
Answered

Search says "Wrong column type expects text type"

(0) ShareShare
ReportReport
Posted on by

I try to search a gallery via a textbox

candide_0-1711286717656.png

 

but there rises an error for the gallery items property

Search(tblZSM,Scr12txtSearchSymptome.Value,"new_lkpSymptom")

 

candide_1-1711286805022.png

 

column lkpSymptom is a LookUp column in a junction table tblZSM

candide_2-1711287103337.png

 

any ideas?

thx

 

 

 

 

 

 

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

    @candide -

     

    Try the below:

     

    Search(
     AddColumns(
     tblZSM,
     "_related_column",
     lkpSymptom.'the name of the field you want to return from the related table'
     ),
     Scr12txtSearchSymptome.Value,
     "_related_column"
    )

     

    The Search function expects a string. It is not possible to use the Search 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 which does not actually exist at source.

     

    We then run a Search against this column to return the result you need.

     

    Notes:

  • candide Profile Picture
    on at

    @Amik 

    works as expected😁 big thanks

     

    Now I additionally need to filter on the combobox Scr12ComboboxFilterKapitel shown in screenshot above

     Search(
     Filter(
     tblZSM,
     Len(Scr12ComboboxFilterKapitel.Selected.Kapitelname) = 0 || lkpKapitel.Kapitelname = Scr12ComboboxFilterKapitel.Selected.Kapitelname 
     ),
    .
    .
    .

     

    Here I have some code which worked in another screen but I have no idea how to add it in your solution.

     

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

    @candide - please remember to accept the solution to the first question.

     

    Regarding the second question, to combine this you can either use:

     

    Search(
     AddColumns(
     Filter(
     tblZSM,
     Len(Scr12ComboboxFilterKapitel.Selected.Kapitelname) = 0 || lkpKapitel.Kapitelname = Scr12ComboboxFilterKapitel.Selected.Kapitelname 
     ),
     "_related_column",
     kpSymptom.'the name of the field you want to return from the related table'
     ),
     Scr12txtSearchSymptome.Value,
     "_related_column"
    )

     

    Or:

     

    With(
     {
     _prefiltered_data: Filter(
     tblZSM,
     Len(Scr12ComboboxFilterKapitel.Selected.Kapitelname) = 0 || lkpKapitel.Kapitelname = Scr12ComboboxFilterKapitel.Selected.Kapitelname 
     )
     },
     Search(
     AddColumns(
     _prefiltered_data,
     "_related_column",
     kpSymptom.'the name of the field you want to return from the related table'
     ),
     Scr12txtSearchSymptome.Value,
     "_related_column"
     )
    )
  • candide Profile Picture
    on at

    @Amik 

    your 1st proposal is now my solution😁

    Thanks a lot. Slight changes did it

    Sort(
     Search( 
     AddColumns(
     Filter(
     tblZSM,
     Len(Scr12ComboboxFilterKapitel.Selected.Kapitelname) = 0 || lkpSymptom.lkpKapitel.Kapitelname = Scr12ComboboxFilterKapitel.Selected.Kapitelname 
     ),
     "_related_column",
     lkpSymptom.Bezeichnung
     ),
     Scr12txtSearchSymptome.Value,
     "_related_column"
     ),
     lkpSymptom.Bezeichnung
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard