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
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.
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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
255 | |
127 | |
85 | |
84 | |
67 |