cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JTischler
Helper II
Helper II

Adding a second filter

I have a text input (txtBOESearch) that is acting as a key word search on multiple columns. I have added a second text input (txtAdmin) that I want to allow people to use as a filter pointing to the 'Learning Admin' gallery column.  What would I need to add to allow both text inputs to work together?  Current Code below:

 

Filter(Sort(
[@BOE],Start_x0020_Date,Ascending
),
txtBOESearch.Text in
Title & "|" & Course_x0020_ID & "|" & End_x0020_Date & "|" & Start_x0020_Date & "|" & Session_x0020_ID ||
IsBlank(txtBOESearch.Text)

)
)

23 REPLIES 23

You're using SharePoint as a datasource you really want to utilize startswith functions and or provide drop down filters and utilize equals (=) instead of in for the filter statements. in, it used more for a table than just a single .displayname value so that's probably throwing it off. 

@cwebb365 I need partial or keyword results vs starts with in the first filter.  The second filter is pointing towards a user/group field so a drop down is not able to be provided as a filter.  If there is an easy way to do it, I am not opposed as long as the ability to type in a name exists 

You can totally provide drop downs for people columns. You just have to pass your update / patch with the proper format in order to update with that selection.  See: PATCH A SharePoint Person Column In Power Apps - Matthew Devaney 

 

You just have a drop down, then replace the fields in the patch with the selected drop down data via lookups or what not. 

 

Because of your data source however you can't use anything but starts with, it's limited, unless you plan on having fewer than 2000 records ever in the data source you are utilizing. Then you can use search function instead. But due to delegation you're going to want to utilize exact matches or startswith when using SharePoint as those will be your only options to not get invalid results once you go over 2000 records in your SP list. 

 

 

@cwebb365 Not sure we are on the same page, or possibly it is my lack of experience in grasping what you are suggesting.

 

I want the users to type in a name in this input box (Enter Admin name):

23.08.2021_14.18.19_REC.png

 

and then have the list filter based on the person identified in this field, which is user/group selection:

 

23.08.2021_14.20.06_REC.png

 

This is my current code:

 


Filter(Sort(
[@BOE],Start_x0020_Date,Ascending
),
txtBOESearch.Text in
Title & "|" & Course_x0020_ID & "|" & End_x0020_Date & "|" & Start_x0020_Date & "|" & Session_x0020_ID ||
IsBlank(txtBOESearch.Text) &&
txtAdmin.Text in "Learning_x0020_Admin"
)

 

text input = txtAdmin

Column name= "Learning_x0020_Admin"

specific field name = pckAdmin

 

what would my new code need to be?

Since you have the box searching then selecting a person, the filter should be txtAdmin.Selected = "Learning_x0020_Admin" what field is that showing the person under the type in box? Assume it's a combo box? What are the Items set to? If it's Choices("Learning_x0020_Admin") the txtAdmin.Selected = "Learning_x0020_Admin" should be what you need to match on a selection there. 

@cwebb365 I think the fields may be backwards?

 

The search Admin is a free text field labeled txtAdmin:

23.08.2021_16.53.19_REC.png

 

The list item contains the user/group field which is where a user is chosen and the specific field is labeled pickAdmin:

 

23.08.2021_08.13.14_REC.png

 

I would think the logic would be to take the partial text typed in txtAdmin and search the pickAdmin.Selected and return like results?

I wouldn't reinvent the wheel. Replace your textbox with a combo box, with multi select turned off, and for the Items property point it to Choices(List.column) to the person column. Then you'll be able to type in and select someone, then use that control in the filter. 

@cwebb365  I was able to get the combo box created and working, it pulls up all the names and I can type in the names like I want.  I have entered in the code I think would work, but it doesn't like the 'Learning Admin' for some reason?

 

Filter(Sort(
[@BOE],Start_x0020_Date,Ascending
),
txtBOESearch.Text in
Title & "|" & Course_x0020_ID & "|" & End_x0020_Date & "|" & Start_x0020_Date & "|" & Session_x0020_ID ||
IsBlank(txtBOESearch.Text) &&
cmbAdmin.Selected in 'Learning Admin'
)

 

23.08.2021_18.00.22_REC.png

I have tried with "" as well as 'Learning Admin'(thats the one that auto populates as suggestion), but neither work or are accepted?

Don't use in, use = 

@cwebb365 It doesn't like the =23.08.2021_18.22.48_REC.png

 

Thank you for you persistent help with this!

 

 

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 (1,530)