how search on the label of a multi-value list field

6 posts by 2 authors in: Forums > CMS Builder
Last Post: June 5, 2014   (RSS)

By craig_bcd - May 20, 2014

As always, I turn to the forum when I am stumped.  I searched the forum and did not find an answer that applied (though I tried a few options) but I am trying to do a search on the label of a multi-value  list field.

So the multi-value list field [services_provided] looks like this:

1|EVS
2|Patient Transport
3|Linen
4|Antos

I want to allow search on the label portion of it (that is what the users will know) not the values portion of it.

The search field looks like this: 

name="title,address_1,address_2,city,state,zip,primary_phone,regional_manager,services_provided:labels,unit_director,bed_size,sq_feet,cc_fname,cc_lname,cc_title,cc_email,cc_phone,antos_pm,contract_start,contract_end,antos_savings_query"

When I use the pseudo field: services_provided:labels it does not find the records but if I change the name in the query to be just "services_provided" and put in say 4 (for Antos) it works just fine.

What can I do to facilitate the user searching on the label (not the value) and actually finding record?

Thanks as always for your help.

By craig_bcd - June 4, 2014

Hi Claire -

Thanks - it's a membership only site so I don't want to post the username and password publicly but I could email it to you if you want - in the meantime I will see if I can be more clear.

I have a table with organization profiles (name, address, city state...etc.) as fields.   There are also services (field name = services_provided) which is defined as a multi-value checkbox field where the choices are defined as:

1|EVS
2|Patient Transport
3|Linen
4|Antos

An organization may take advantage of one, or multiple services, from that list.

I defined a search form with all of the fields using  _query in the "name" section of the form (see below)

name="title,address_1,address_2,city,state,zip,primary_phone,services_provided,unit_director_query"

if I search for "EVS" for example it does not find any records, it only finds them if I search on "1".  Obviously the user isn't going to know the correlation, I need to be able to search on "EVS" and find the associated records.  I tried to change the field name in the search form to: services_provided:labels but it does not work.

Please let me know if you understand or want me to email you connection information.

thanks again for your help

By claire - June 4, 2014

Hi Craig

I think I understand what you're trying to do. I'll have a chat with a few other devs here and see what we can come up with.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By craig_bcd - June 4, 2014

Hi Claire - thank you so much!

By claire - June 5, 2014

Hi Craig

I've talked it over with another dev here and I don't think there's a quick fix available for this one. I did confirm that the pseudo field won't work in the search query at least.

Is it possible for you to remove the number values from the list, or do these reference another table?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/