cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tonysommer
Level: Powered On

Not sure where to place search function

My current formula for my Gallery Items property is:

If(isAdmin,Sort(AllTickets,Created,Descending),Sort(Filter(AllTickets,Author.Email=MyProfile.Mail||Author.Claims=MyProfile.UserPrincipalName),Created,Descending))

 

I would like to add search functionality to filter all tickets:

 

Search(AllTickets, SearchBox.Text, "Title", "AssignedTo","Priority","TaskStatus")

 

However I am not sure where to put this at to allow both displaying all tickets and letting me search the gallery.

 

Any suggestions?

2 ACCEPTED SOLUTIONS

Accepted Solutions
PowerAddict
Level 10

Re: Not sure where to place search function

Hi,

You have combined Sort and Filter correctly. You just need to replace AllTickets within your Filter by the search expression and also in the first sort function.

Something like this:

If(isAdmin,Sort(Search(AllTickets, SearchBox.Text, "Title", "AssignedTo","Priority","TaskStatus"),Created,Descending),Sort(Filter(Search(AllTickets, SearchBox.Text, "Title", "AssignedTo","Priority","TaskStatus"),Author.Email=MyProfile.Mail||Author.Claims=MyProfile.UserPrincipalName),Created,Descending))

Let me if this doesn't work.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

Community Support Team
Community Support Team

Re: Not sure where to place search function

Hi @PowerAddict ,

 

So far it is not possible to use the Search function for column types other than strings. 

 

There is a workaround which is using a collection created with your SharePoint list, then use the AddColumns function to run a calculation on the non-text field and turning it into a new field that was a text item. Then use Search on the newly created field.

 

AddColumns(myTable, "newColumn", PlainText(oldColumn.Value))

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
PowerAddict
Level 10

Re: Not sure where to place search function

Hi,

You have combined Sort and Filter correctly. You just need to replace AllTickets within your Filter by the search expression and also in the first sort function.

Something like this:

If(isAdmin,Sort(Search(AllTickets, SearchBox.Text, "Title", "AssignedTo","Priority","TaskStatus"),Created,Descending),Sort(Filter(Search(AllTickets, SearchBox.Text, "Title", "AssignedTo","Priority","TaskStatus"),Author.Email=MyProfile.Mail||Author.Claims=MyProfile.UserPrincipalName),Created,Descending))

Let me if this doesn't work.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

tonysommer
Level: Powered On

Re: Not sure where to place search function

it is saying the Search function has some invalid arguments.

tonysommer
Level: Powered On

Re: Not sure where to place search function

Apologies it does work. When it is the following:

If(isAdmin,Sort(Search(AllTickets, SearchBox.Text, "Title"),Created,Descending),Sort(Filter(Search(AllTickets, SearchBox.Text, "Title"),Author.Email=MyProfile.Mail||Author.Claims=MyProfile.UserPrincipalName),Created,Descending))

 

However whenever I add anything other than "Title" it states that there are some invalid arguments.

PowerAddict
Level 10

Re: Not sure where to place search function

So you can only use text fields for searching. I believe Title is a text field. If you were trying to search by any other field that's not text, it will throw an error.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)
tonysommer
Level: Powered On

Re: Not sure where to place search function

No other way around this to search choice fields or drop-downs or anything?

PowerAddict
Level 10

Re: Not sure where to place search function

Nothing that's available out of the box using Search function. However you can use filter function to get a list of the desired results. Will that work?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)
Community Support Team
Community Support Team

Re: Not sure where to place search function

Hi @PowerAddict ,

 

So far it is not possible to use the Search function for column types other than strings. 

 

There is a workaround which is using a collection created with your SharePoint list, then use the AddColumns function to run a calculation on the non-text field and turning it into a new field that was a text item. Then use Search on the newly created field.

 

AddColumns(myTable, "newColumn", PlainText(oldColumn.Value))

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,695)