Skip to Content Skip to Menu

Help with auto

  • ComLeads
  • ComLeads
  • OFFLINE
  • Posts: 37
  • Thanks: 1
  • Karma: 0
9 years 10 months ago #254931 by ComLeads
Help with auto was created by ComLeads
Hi,

I can't manage to trigger "join a group".
My CB user is prepopulated with users having 5 variables (only one mandatory) linked to existing private groups.
I have 3700 users (registered) who can belong to up to 5 groups.

I wish to use auto to make them join automatically the groups.
I tried the triggers onDuringLogin,gj_onAfterUpdateUser,onAfterLogin,onAfterUserUpdate,onAfterCheckCbFieldsDb,onAfterCheckCbDb

User: user
Group access : I selected CMS ACL / registered but should I also select Custum ACL / All members ? or other groups ?

Then my conditions : is it conditions OR or AND ? I want OR but I am sure it works that way ?
[cb_classeenfant1]=CP1
[cb_classeenfant2]=CP1
[cb_classeenfant3]=CP1
[cb_classeenfant4]=CP1
[cb_classeenfant5]=CP1
Anyway, I tried with only one condition and it's not working.

Action : Join group "Classe CP1".

I tried all the triggers and none is working.
I am on local Mamp with Joomla 3, CB 1.9.

Thanks for your help.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
9 years 10 months ago #254937 by krileon
Replied by krileon on topic Help with auto
Conditionals are AND. They have no OR functionality. For OR of the same field you'd just Regex operator and match multiple values (e.g. /VALUE1|VALUE2|VALUE3/). When do you want to automatically join groups? You need to provide more details of what you want it to do and when specifically.


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.

  • ComLeads
  • ComLeads
  • OFFLINE
  • Posts: 37
  • Thanks: 1
  • Karma: 0
9 years 10 months ago #254948 by ComLeads
Replied by ComLeads on topic Help with auto
Hi,

The community is for parents which can have up to 5 kids in the school. We have the association listing imported which list for each parent each class they children belong to.
[parent-fullname] have variables [cb_classeenfant1][cb_classeenfant2][cb_classeenfant3][cb_classeenfant4][cb_classeenfant5].
[cb_classeenfant*] can have 100 different value (=100 different classrooms=100 private groups).

We want to tell the parents to come to the website and sign in to access their children's class discussion group. Each year, the user list of a group will change as the children change class levels.
One parent can belong to 1 to 5 groups.
For example, let's say M Smith has a child in class CP1 and one in class CM1C, I want him to be automatically registered as member of the private group "CP1" and as member of the private group "CM1C" when he signs in.
One of the trick is that 5 variables [cb_classeenfant1][cb_classeenfant2][cb_classeenfant3][cb_classeenfant4][cb_classeenfant5] can have the value CP1. For one parent, their child one will be in classroom CP1 but another parent can have their child 3 in classroom CP1.
So I would need to know if I can do something like var1 OR var2 or Var3 = CP1. So, if this is not possible, does it mean I have to do an auto for each VAR = CP1 ?

I would be happy to be able to populate the groups before I open the website but I don't know which trigger. I tried the after db check. But I am missing something. I am using the CB tool "check CB DB", is that the correct trigger ? If I use this trigger, should I input my own user ID as user ?

I hope I am not to confusing with my French questions translated in English...
Thanks for your help.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
9 years 10 months ago #255009 by krileon
Replied by krileon on topic Help with auto

So, if this is not possible, does it mean I have to do an auto for each VAR = CP1 ?

Yes or you can use a substitution IF statement as follows.

Left: [cb:if cb_classeenfant1="CP1" or cb_classeenfant2="CP1"]1[/cb:if]
Operator: Equal To
Right: 1

If the substitution IF matches successfully it'll output a 1, which will cause the equal to to match successfully.

I would be happy to be able to populate the groups before I open the website but I don't know which trigger. I tried the after db check. But I am missing something. I am using the CB tool "check CB DB", is that the correct trigger ? If I use this trigger, should I input my own user ID as user ?

If you're wanting to fire this action on every user all at once instead of say on login then you need to use the Internal Users trigger and click the internal users link found in CB Auto Action (edit it from plugin management). This will cause all actions with the internal users trigger to fire on every user row. Only do this if you're certain it will behave how you're expecting.


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.

  • ComLeads
  • ComLeads
  • OFFLINE
  • Posts: 37
  • Thanks: 1
  • Karma: 0
9 years 10 months ago #255243 by ComLeads
Replied by ComLeads on topic Help with auto
Hi,

Thanks for the If statement, it will do the trick.

On the Internal Users trigger, I am sorry but I don't understand, must be a problem of English understanding on my side...

By "Internal Users trigger" do you mean triggers listed under "backend" in Auto trigger list ? I don't see which one you're talking about.
Regarding the internal users link, I didn't find any but I guess I misunderstood your information. From what I understood, I went to CB plugin management and click on CB auto but I found no link.
Sorry but I need a more detailed process if you want to get rid of me ;) (well for that subject at least)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
9 years 10 months ago #255257 by krileon
Replied by krileon on topic Help with auto

ComLeads wrote: Hi,

Thanks for the If statement, it will do the trick.

On the Internal Users trigger, I am sorry but I don't understand, must be a problem of English understanding on my side...

By "Internal Users trigger" do you mean triggers listed under "backend" in Auto trigger list ? I don't see which one you're talking about.
Regarding the internal users link, I didn't find any but I guess I misunderstood your information. From what I understood, I went to CB plugin management and click on CB auto but I found no link.
Sorry but I need a more detailed process if you want to get rid of me ;) (well for that subject at least)

You need to be using the latest release of CB Auto Actions for your CB version. Then when editing your action you should see at the very top "Internal Users" and "Internal General" of the triggers dropdown. When your action is setup to act on "Internal Users" you can use the internal users url within (CB 2.x) CB > Plugin Management > CB Auto Actions > Parameters or (CB 1.x) CB > Plugin Management > CB Auto Actions > Configuration > Internal. Using these URLs causes all actions with their special triggers to fire. Internal Users specifically will loop every user on your site and send them through the action.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum