cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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!

Highlighted
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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,768)