cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
laadams
Frequent Visitor

Combo Box with Multiple SearchField

I have a combo box that's a Double Layout and I would like it to search within the primary and secondary texts from a SharePoint list. Let's say the Primary Text is "ColumnA" and Secondary Text is "ColumnB" from the SharePoint list. In SearchFields, I tried putting in ["ColumnA", "ColumnB"] but it keeps automatically changing SearchFields to "ComplianceAssetID" which I'm not sure where that came from, I think it's a list property and not an actual column on my list. Is there something wrong with my syntax?

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks Kris! Yeah I'm trying to make my ComboBox to search based on 2 fields in my SP list. I actually figured out what's screwing it up. In my SP list one of my columns is set to a choice rather than single text. Once I changed it to single text, I was able to use both columns to be searched.

 

Good to know that another workaround is to add the list to a collection and then search from that. Thank you!

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

HI @laadams ,

Do you want your ComboBox to search based on two fields in your SP list?

 

Based on that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:7.JPG

The GIF screenshot as below:Test.gif

 

Please consider re-add a ComboBox control within your app, then set the Items property to your SP list data source.

Within right Data panel, set the Primary text field to ColumnA, Set the Secondary text to ColumnB. Go to the SearchFields field, type the following formula:

["ColumnA", "ColumnB"]

In additon, please consider save your SP list data source into a Collection firstly, then use the Collection as data source within your ComboBox.

Set the OnStart property of the App control to following:

ClearCollect(RecordsCollection, 'YourSPList')

Set the Items property of the ComboBox to following:

RecordsCollection

then re-configure your ComboBox to search based on your two columns, check if the issue is solved.

 

Best regards,

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

Thanks Kris! Yeah I'm trying to make my ComboBox to search based on 2 fields in my SP list. I actually figured out what's screwing it up. In my SP list one of my columns is set to a choice rather than single text. Once I changed it to single text, I was able to use both columns to be searched.

 

Good to know that another workaround is to add the list to a collection and then search from that. Thank you!

View solution in original post

MaciejB
Frequent Visitor

Hi, I just did this to make it work :

 

WRONG : In the searchfields I tried : ["Field1" ; "Field2"] (or ["Field1" , "Field2"] in US)

But actually you have to use "&" to separate your field ! Just like this :

 

["Field1" & "Field2"]

 

I hope my answer will help you !

 

_____________________________________________________

Edit : It did not work very long (why did it stopped working?)

So here's how I did it:

 

I added a column in sharepoint, and made a concatenation of each column.

My search field is the last column which contains every field (Yes this solution is ugly, but it works for me ^^).

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,315)