List Filter issue with Multiselect Fields

11 years 3 months ago #137089 by JoomIM
Hi,

I am developing a Services Directory where one individual (a service provider) may promote multiple services in one or more geographical regions.

If the individual (service provider) only selects ONE region, the filter works fine. ie: user1 operates in region1, then they appear under the list for region1

However, as soon as a user selects MORE THAN ONE region, ie: user1 operates in region1 and region2,
they no longer appear in lists for either region1 or region2.

I am currently using a list filter where 'cb_region' ='region1'.


I have tried to select 'cb_region' LIKE'%region1%' and this DOES work, but the result displays a list that includes other users where the region name is similar, ie: 'cb_region' LIKE'%city west%' also lists anyone who is in other regions such as city south west, city north west, etc.

Any assistance would be greatly appreciated!

This is my first project with CB, and have been faced with a steep but ENJOYABLE learning curve :)

Post edited by: JoomIM, at: 2010/07/04 05:31

Please Log in to join the conversation.

11 years 3 months ago #137194 by krileon
Replied by krileon on topic Re:List Filter issue with Multiselect Fields
Filters are direct additions to the query, a multi-select of any type is stored as follows within the database.

value1|*|value2|*|value3, etc...

This means you'll need to use a LIKE attribute with wildcards such as the following.

`cb_myfield` LIKE '%value2%'

However, wildcards means similar results will display for example if you use '%value1%' then value10, value11, etc.. would show.

More on MYSQL and query functions/usages can be found here .


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 2 months ago #140578 by Princess2Die4
Replied by Princess2Die4 on topic Re:List Filter issue with Multiselect Fields
I too am faced with this issue. I run a videogame clan site, there are two clans girls and guys, then two consoles. i want to have 5 user lists, two for each clan absed on gender and consoles, and one for all users. i have the filters in places of the users lists, but as soon as i add a filter from a different cb feild the list doesnt work. ive tried "like" but it doesnt work either. please help.
sorry about the post, i got it workin

Post edited by: Princess2Die4, at: 2010/08/24 00:59

Post edited by: Princess2Die4, at: 2010/08/24 01:31

Please Log in to join the conversation.

11 years 2 months ago #140623 by krileon
Replied by krileon on topic Re:List Filter issue with Multiselect Fields
Well you didn't provide the field type, the fields values, nor an example from your database as to how the field is stored. Without that no one can help you, we don't know how your field is structured so can't advise on filter structure. ;)

Please keep in mind filters are just additions to a query so they must be built likey queries. Please see my above post concerning wildcards as well as link to MYSQL documentation.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.186 seconds

Facebook Twitter LinkedIn