Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

CB Conditional

11 years 3 months ago #231101 by ninokorinteli
CB Conditional was created by ninokorinteli
Hi,
Having hard times with conditioning, probably doing something wrong either in choosing operator or with value field in conditional

here is example

field name: Profile (single select drop down) - values: Actor, Dancer, Vocalist, Mime, etc, etc and say 10 more values;

Tab name: Physical Info
Tab's conditional - if field: profile operator: does contain value: 'Actor' OR 'Dancer' OR 'Vocalist' OR 'Mime' then mode: show profile: enabled, profile view: enabled direction: two-way.

I need this tab to show up on profile and profile edit only if either of those values selected from profile field. it does not. pls help
Thank you in advance
nino

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231114 by krileon
Replied by krileon on topic CB Conditional

'Actor' OR 'Dancer' OR 'Vocalist' OR 'Mime'

No such usage exists. If you need to match multiple values you need to use a REGEX operator and use REGEX to match for the value. Example as follows.

/Actor|Dancer|Vocalist|Mime/


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 or Create an account to join the conversation.

11 years 3 months ago #231296 by ninokorinteli
Replied by ninokorinteli on topic CB Conditional
Thanks a lot works perfectly!

have a couple of related questions:

if condition some field in relation to single check box what operator better to use 'not empty' (if checked) or 'equal to' Yes, since unchecked value is No

Also i have set configuration not to show empty fields on profile, but all unchecked check box fields showing up with value No against field name. add condition not show on profile view if field value = No?

with multi select check box - which operator better to match one of the values - contain or equal to?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231328 by krileon
Replied by krileon on topic CB Conditional

if condition some field in relation to single check box what operator better to use 'not empty' (if checked) or 'equal to' Yes, since unchecked value is No

Single checkboxes store 1 for yes and 0 for no. It's best to check if the value is equal to 1 or not equal to 1 to see if it's checked or not.

Also i have set configuration not to show empty fields on profile, but all unchecked check box fields showing up with value No against field name. add condition not show on profile view if field value = No?

A checkbox is never truly empty I believe so hiding empty checkboxes won't work using that feature, but you could hide them using CB Conditional if their value isn't 1 (checked).

with multi select check box - which operator better to match one of the values - contain or equal to?

If you need to match 1 value of a multi select type field (multi checkbox, multi dropdown, etc..) then use either of the Contains operators.


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 or Create an account to join the conversation.

11 years 3 months ago - 11 years 3 months ago #231447 by ninokorinteli
Replied by ninokorinteli on topic CB Conditional
Thank you very much, works great, i used field conditional self, but just in case is it any difference which to use conditional self or conditional others when conditioning field just to hide or show without relation to any other field, like in this case setting checkbox field invisible on profile?
Last edit: 11 years 3 months ago by ninokorinteli.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago - 11 years 3 months ago #231465 by krileon
Replied by krileon on topic CB Conditional
It depends on the situation, but conditional self tends to behave better. Sometimes it's more practical to put the conditional on the field that's doing the conditioning. For example say you've a profile type field and you need 30 fields to show if the value is equal to business. In that case you'd use conditional others and just select those 30 fields, but if you need 30 different fields to condition from various profile type then it'd be best to use conditional self on those 30 different fields.


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.
Last edit: 11 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum