Skip to Content Skip to Menu

Auto Action: check multiple select items when one items is checked

  • danpoole
  • danpoole
  • OFFLINE
  • Posts: 49
  • Thanks: 6
  • Karma: 0
6 years 2 months ago #307273 by danpoole
Hi This is what I'm trying to achieve.
  1. I have a CB field called cb_modulescompleted it has values such as Module 1, Module 2, Module 3 etc.
  2. if a user has completed Module 3 then they would have also completed module 1 & 2 and those values should also be selected in the field
  3. the user database has been poorly maintained an in alot of cases Modules 1 & 2 have not been selected
  4. I am trying to make an Auto Action to check Module 1 & Module 2 values (checkboxes) if module 3 is selected

Auto Action Setup:
==============
Global
Triggers: onAfterLogin, onAfterUserProfileSaved
Type: Field

Conditions
Value: [cb_modulescompleted]
Operator: Is REGEX
Value: /m3/
Translate: checked
Format: checked
Prepare: unchecked

Action
Field: cb_modulescompleted
Operator: Set (Field = Value)
Value: m1
Translate Value: No
Save Directly: Yes

Now in the users section when I check Module 3 and save, the result is Module 1 is checked but Module 3 gets unchecked. Please note that I have also used the + Add Rows button to the right and did the same action values as above but changed the value to m2. When doing this the Module 2 checkbox is checked instead of checkbox 1.

I hope this is enough to go on, any guidance on this would be greatly appreciated.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 2 months ago #307278 by krileon
Multicheckbox and Multiselect fields store as |*| delimitered. This means if multiple values are selected you'd have VALUE_1|*|VALUE_2|*|VALUE_3 for example. So you should be setting your field to m1|*|m2|*|m3 based off the information you've provided.


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: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum