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, Filter, Lookup...
Power Apps
Unanswered

Search, Filter, Lookup.... Nothing is really working

(0) ShareShare
ReportReport
Posted on by 76

I have tried several times with Search, Filter and then Lookup. The table is called "Trackings", my text box is called txt_Search_Assigned and the field is "Assigned to:" and is a lookup field using the AAD. When I add Search or Filter to the code below, I either get a incompatible search type or just an error with no other hints except something is wrong. I am in Teams trying to build a Canvas app.  Thank you for any help in figuring this out.

 

This code works great.

Sort(

         Search(     

              Filter(

                Trackings,

               IsBlank(dd_Search_Status.Selected.Value) || IsEmpty(dd_Search_Status.Selected.Value) ||'Status (crc44_status)' = dd_Search_Status.Selected.Value),            

                txt_search_Subject.Value,"crc44_subject"),

                 'CPAR Number',

              SortOrder.Descending

)

*********************************

This code does not work.

Sort(

         Search(     

               Search(

                  Filter(

                Trackings,

               IsBlank(dd_Search_Status.Selected.Value) || IsEmpty(dd_Search_Status.Selected.Value) ||'Status (crc44_status)' = dd_Search_Status.Selected.Value),            

                txt_search_Subject.Value,"crc44_subject"),

                txt_search_Assigned, "crc44_Assignedto:"),

                 'CPAR Number',

              SortOrder.Descending

)

 

Categories:
I have the same question (0)
  • vikas1606 Profile Picture
    206 on at

    @Sadiejane  - Can you confirm txt_search_Assigned should not have .Value like txt_search_Subject.Value we have in the above line?

    vikas1606_0-1679511756642.png

     

  • Sadiejane Profile Picture
    76 on at

    Sorry, yes I had .Value in there, I just missed it when I added it to the sample. 

     

    Sort(

    Search(
    Search(

    Filter(

    Trackings,

    IsBlank(dd_Search_Status.Selected.Value) || IsEmpty(dd_Search_Status.Selected.Value) ||'Status (crc44_status)' = dd_Search_Status.Selected.Value),

    txt_search_Subject.Value,"crc44_subject"),
    txt_search_Assigned.Value,"crc44_Assignedto"),

    'CPAR Number',

    SortOrder.Descending

    )

  • vikas1606 Profile Picture
    206 on at

    I have just formated your code. Could you please use the below code and let me know if you still have any errors?

    Sort(
    Search(
    Search(
    Filter(
    Trackings,
    IsBlank(dd_Search_Status.Selected.Value) || IsEmpty(dd_Search_Status.Selected.Value) || 'Status (crc44_status)' = dd_Search_Status.Selected.Value
    ),
    txt_search_Subject.Value,
    "crc44_subject"
    ),
    txt_search_Assigned.Value,
    "crc44_Assignedto:"
    ),
    'CPAR Number',
    SortOrder.Descending
    )

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Sadiejane,

     

    I noticed 3 things: (1) As @vikas1606 mentioned, the second txtInput does not has a .Value as the first one does, (2) I would expect the TextInput to be .Text and not .Value (3) is Assigned To: a LookUp to a User, because you can only search text fields.

     

    In the options below, I will replace .Value with .Text because that worked in my case. Should it be different for you, feel free to replace it again.

     

    (1) crc44_Assignedto: is a text field

    Sort(
     Search( 
     Search(
     Filter(
     Trackings,
     IsBlank(dd_Search_Status.Selected.Value) || IsEmpty(dd_Search_Status.Selected.Value) ||'Status (crc44_status)' = dd_Search_Status.Selected.Value
     ), 
     txt_search_Subject.Text, "crc44_subject"
     ),
     txt_search_Assigned.Text, "crc44_Assignedto:"
     ),
     'CPAR Number',
     SortOrder.Descending
    )

     

    (2) crc44_Assignedto: is a LookUp to for example the User table:

    Sort(
     Search(
     AddColumns( 
     Search(
     Filter(
     Trackings,
     IsBlank(dd_Search_Status.Selected.Value) || IsEmpty(dd_Search_Status.Selected.Value) ||'Status (crc44_status)' = dd_Search_Status.Selected.Value
     ), 
     txt_search_Subject.Text, "crc44_subject"
     ),
     "AssignedToFullName",
     'Assigned to:'.'Full Name'
     ),
     txt_search_Assigned.Text, "AssignedToFullName"
     ),
     'CPAR Number',
     SortOrder.Descending
    )

    Double check whether the Assigned to column name was correctly written.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Sadiejane Profile Picture
    76 on at

    I still have errors when I run this code. Thank you for your help on this-I hope we can figure it out.

  • Sadiejane Profile Picture
    76 on at

    Also, when I type the . after txt_search_Assigned, the prompt is for Value. But when I roll over the red squiggly line it says "Expect Text Type", but when I try .text that gives me errors too.

  • vikas1606 Profile Picture
    206 on at

    @Sadiejane 

    Can you wrap txt_search_Assigned.Value with Text function and try it?

    Text(txt_search_Assigned.Value)

  • Sadiejane Profile Picture
    76 on at

    Still errors and says wrong column type. Expects type text.

  • Sadiejane Profile Picture
    76 on at

    I have now just tried to search or filter all by itself and continue to get errors-so maybe it's something else.

  • Sadiejane Profile Picture
    76 on at

    Hi Laurens-Thank you for trying. This did not work. Could it be that the "Assigned to:" is using a lookup in the AAD table? The AAD table is the active directory table. I tried to just do a search or filter statement and I can't get anything to work. I am just not sure what else to try.

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