cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akosbanar
Advocate IV
Advocate IV

Issue in Search function

Dear All,

 

I found an interesting issue or paradox in Search function usage. 

I have a gallery what I filter with a textinput. Its seems like very easy, it isn't.

(Gallery -> Items)

akosbanar_0-1639483193705.png

As you can see for any reason the Power App underlines my code with red but it is working normally (also in the gallery).

The bigger problem when I'd like to use another column too in the Search function it already doesn't working.

 

akosbanar_2-1639483625870.png

 

 

 

If(
    IsBlank(Search_box.Text),
    PBIappsCollection,
Search(
        PBIappsCollection,
        Search_box.Text,
        "UseableTags",
        "Project Name"    
        )
)

 

 

 

I tried another method as well but with the same result.

 

 

 

If(
    IsBlank(Search_box.Text),
    PBIappsCollection,
Search(
        Filter(
            PBIappsCollection,
            Search_box.Text in UseableTags
        ),
        Search_box.Text,
        "Project Name"
	)
)

 

 

 

 

Note: "PBIappsCollection" is an Excel Online connector's data source.

 

Can you help me?

1 ACCEPTED SOLUTION

Accepted Solutions
akosbanar
Advocate IV
Advocate IV

I solved. 

 

It is still red underlined but working.

akosbanar_0-1639485524448.png

 

 

 

If(
    IsBlank(Search_box.Text),
    PBIappsCollection,
    Filter(
        PBIappsCollection,
        Search_box.Text in UseableTags || Search_box.Text in 'Project Name'
    )
)

 

 

View solution in original post

7 REPLIES 7
akosbanar
Advocate IV
Advocate IV

I solved. 

 

It is still red underlined but working.

akosbanar_0-1639485524448.png

 

 

 

If(
    IsBlank(Search_box.Text),
    PBIappsCollection,
    Filter(
        PBIappsCollection,
        Search_box.Text in UseableTags || Search_box.Text in 'Project Name'
    )
)

 

 

AJ_Z
Super User
Super User

what does it say when you hover over the red?

If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !

akosbanar
Advocate IV
Advocate IV

@AJ_Z 

akosbanar_1-1639485779859.png

This is the current error message with Filter function.

AJ_Z
Super User
Super User

Sorry i see your problem i can't believe i never saw it sooner.

try this:

 

If(
    IsBlank(Search_box.Text),
    PBIappsCollection,
    Search(
        PBIappsCollection,
        Search_box.Text,"UseableTags","'Project Name'"
    )
)

 

But this part "UseableTags","'Project Name'" will likely be different see what the app populates the column names as. Also ensure that Useabletags is string and project name is string for this method

 

If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !

@AJ_Z 
Me neither.

I created a test gallery because I don't want to wrong my existed good solution. 

akosbanar_0-1639488172837.png

I know that your code is absolutely correct because based on the MS documents but it isn't working.

akosbanar_1-1639488250528.png

 

i really think its the column names back space to until you reach Test_Textinput.text and see what column names it gives. i am happy to get on a teams call and screenshare to help troubshoot if needed

 

 

If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !

akosbanar
Advocate IV
Advocate IV

@AJ_Z 
Thank you for the opportunity but I think it is a Microsoft issue, at my company we realized more performance problems today and yesterday. 

The other thing that the code is working with Filter function what is the same as the Search just a little slower.

Some days later I check again it is still red underlined or already not.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,176)