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!

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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,489)