cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
A-HJ
Frequent Visitor

Filter Gallery and Search Function

I have a gallery which has a search box attached to it, I have tried the follow two formula in the Items of the gallery:

Search(
    Filter('Incident Report', Lower('Notified Users'.Email) = Lower(User().Email)),
    TextInputSearchBox.Text,
    "Title")

or

Filter(
    Search('Incident Report', TextInputSearchBox.Text, "Title"),
    Lower('Notified Users'.Email) = Lower(User().Email))

Both of which keep through the following formula error message:

Incompatible types for comparison.

These types cant be compared in the formula: Table, Text.

 

We cant evaluate your formula because the values being compared in the formula aren't the same type.

Location: GalIncReport.Items

 

Both filter formula and search formula (below) both work when used independently of each other but not when combined to the above.

Filter('Incident Report', Lower('Notified Users'.Email) = Lower(User().Email)

Search('Incident Report', TextInputSearchBox.Text, "Title")

 

The OnSelect property of the gallery has the following variable

Set(
VarTab,
"Incident Details"
) && Set(
VarRecord,
ThisItem
)

 

For info gallery data is pulling from a SharePoint list.  'Notified Users' Column of the SharePoint list is a People and Group type

 

Any assistance would be very much appreciated

2 REPLIES 2
RandyHayes
Super User
Super User

@A-HJ 

You are best to filter and then search as search is not a delegable function.

Your formula should be the following:

Search(
    Filter('Incident Report', 
        StartsWith('Notified Users'.Email, User().Email)
    ),
    TextInputSearchBox.Text,
    "Title"
)

If that still gives you and error, please look at your Notified Users column definition - is it set up to allow multiple selections?

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks for your help with this.  Have checked the notified users column in SharePoint and this is set to allow multiple users.

 

I am now getting the two following errors:

Invalid argument types (Table). Expecting a Text value instead

and

This function 'StartsWith' has some invalid arguments

 

In short I need the gallery not show items to the if the logged in user does not appear in the Notified Users column of the SharePoint list.  I than need the search box to be functional which search the Title field of SharePoint list.  The notified users column is not displayed in the gallery though.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,327)