cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter Gallery using multiple input text

Hi,

 

I am trying to filter gallery using multiple input boxes, and the same time i am trying to set permission to see only item which was created by current user using Author.Email = User().Email.

I can filter using one Input Box easily but it doesn't work for multiple input boxes, here is the formula i tried and attached the screenshot of my app.

 

Working with one Input Box:

Gallery.Items = Filter([@FilterMasterList],StartsWith(Title,txtSearchBox.Text)||StartsWith('Product Name',txtSearchBox.Text)||StartsWith('Request Status'.Value,txtSearchBox.Text)||StartsWith(FullName,txtSearchBox.Text))

If i replace txtSearchBox.Text, something like below....

 

Filter([@FilterMasterList],StartsWith(Title,txtSearchBox.Text)||StartsWith('Product Name',txtSearchBox.Text)||StartsWith('Request Status'.Value,txtSearchBox.Text)||StartsWith(FullName,txtSearchBox.Text)) || StartsWith(FullName, txtProductNameFilter.Text))

It simply doesn't work.

Also how to show only those items which was created by current user?

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Filter Gallery using multiple input text

thanks @yashag2255, i worked it out differently. 

posting it here, it may help someone..

SortByColumns(
Filter(
[@FilterMasterList],
If(
IsBlank(txtSearchBox.Text),
true,
txtSearchBox.Text in Title || txtSearchBox.Text in FullName || txtSearchBox.Text in 'Product Name' || txtSearchBox.Text in 'Request Status'.Value
) && If(
IsBlank(txtRequestIdFilter.Text),
true,
txtRequestIdFilter.Text in Title
) && If(
IsBlank(txtReqNameFilter.Text),
true,
txtReqNameFilter.Text in FullName
) && If(
IsBlank(txtProductNameFilter.Text),
true,
txtProductNameFilter.Text in 'Product Name'
) && If(
IsBlank(txtStatusFilter.Text),
true,
txtStatusFilter.Text in 'Request Status'.Value
) && If(
lblShowOnlyToAuthUsers.Text = "false",
Lower(Author.Email) = GetCurrentUserEmail,
true
)
),
"ID",
If(SortDescending1, Ascending, Descending)
)

Thank you!

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Filter Gallery using multiple input text

Hi @Anonymous 

 

This is not working because of the bracket mismatch, StartsWith is written when the Filter expression is closed. Can you try to update the expression to:

Filter([@FilterMasterList],StartsWith(Title,txtSearchBox.Text)||
StartsWith('Product Name',txtSearchBox.Text)||
StartsWith('Request Status'.Value,txtSearchBox.Text)||
StartsWith(FullName,txtSearchBox.Text) ||
StartsWith(FullName, txtProductNameFilter.Text))

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Anonymous
Not applicable

Re: Filter Gallery using multiple input text

thanks @yashag2255, i worked it out differently. 

posting it here, it may help someone..

SortByColumns(
Filter(
[@FilterMasterList],
If(
IsBlank(txtSearchBox.Text),
true,
txtSearchBox.Text in Title || txtSearchBox.Text in FullName || txtSearchBox.Text in 'Product Name' || txtSearchBox.Text in 'Request Status'.Value
) && If(
IsBlank(txtRequestIdFilter.Text),
true,
txtRequestIdFilter.Text in Title
) && If(
IsBlank(txtReqNameFilter.Text),
true,
txtReqNameFilter.Text in FullName
) && If(
IsBlank(txtProductNameFilter.Text),
true,
txtProductNameFilter.Text in 'Product Name'
) && If(
IsBlank(txtStatusFilter.Text),
true,
txtStatusFilter.Text in 'Request Status'.Value
) && If(
lblShowOnlyToAuthUsers.Text = "false",
Lower(Author.Email) = GetCurrentUserEmail,
true
)
),
"ID",
If(SortDescending1, Ascending, Descending)
)

Thank you!

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,827)