Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

[SOLVED] AA condition

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 11 months ago - 6 years 10 months ago #300542 by sirweb
[SOLVED] AA condition was created by sirweb
Hello,
Trying to add a user to a group, based on a multiselect field.
cb_field can have values A,B,C,D,E,F,G,H
and I want to have a condition like
if 'cb_field' is one of 'A,B,D,H'
I guess SQL would be: cb_field IN (A,B,D,H)
Last edit: 6 years 10 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 11 months ago #300569 by krileon
Replied by krileon on topic AA condition
You'll need to use REGEX to match multiple values. Example as follows.

[cb_field] Is Regex /^(A|B|D|H)$/

Using | you can create OR cases in REGEX.


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.
The following user(s) said Thank You: sirweb

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

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 11 months ago #300598 by sirweb
Replied by sirweb on topic AA condition

krileon wrote: You'll need to use REGEX to match multiple values. Example as follows.

[cb_field] Is Regex /^(A|B|D|H)$/

Using | you can create OR cases in REGEX.


Thanks a lot! :)

Is the syntax documented somewhere, especially the special characters in /^(A|B|D|H)$/ ?

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

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 11 months ago #300599 by sirweb
Replied by sirweb on topic AA condition

krileon wrote: You'll need to use REGEX to match multiple values. Example as follows.

[cb_field] Is Regex /^(A|B|D|H)$/

Using | you can create OR cases in REGEX.


Sorry, there is something I don´t understand here.
(Using real field names and values below)
Checking ONE value in the multiselect checkbox field cb_befattning works ok, i.e. KA.
Selecting TWO values, i.e. KA and IT the condition fails, but why:

:: Action 64 :: Conditional 2 failed for user 67: KA|*|IT Is REGEX /^(KA|PR|EP|VP|DE|CM|SE|SK|CA|VS|VK|IT)$/

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 11 months ago #300604 by krileon
Replied by krileon on topic AA condition
Remove the ^ and $ since you need to do an inline match. Example as follows.

[cb_befattning] Is REGEX /KA|PR|EP|VP|DE|CM|SE|SK|CA|VS|VK|IT/


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.
The following user(s) said Thank You: sirweb

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

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 10 months ago #300744 by sirweb
Replied by sirweb on topic AA condition
Oh yes, problem solved, works perfect. :)
Thank you!
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum