As an admin, you can create and define a rule which has a set of user conditions and a set of classroom conditions. Rules are conditional actions that are triggered on specific workflows. Once a rule is created, when a user is created or updated (based on the rule trigger) that matches the given set of user conditions, the user will get automatically added to all the classrooms that match the classroom conditions. Let's see how the rules are created and how they work.
This article will guide you on:
The rules created with 'User added' trigger will be triggered only when a new user is added to the site.
1. Open the sidebar and click Manage Rules.

2. The Manage Rules page opens. Click Add Rule.
3. Add the rule title as per your requirement.
4. Click the Choose a trigger dropdown and select the User added option.
5. As the 'User added' trigger has only a single action - 'Add users to classroom', it will be selected automatically.
6. Click Create Rule.
7. The rule creation form open. Enter the rule description, if required.
8. Click Add a new condition for the trigger.
9. Click the Select filter drop down.
10. Select the required field. The fields will be based on the user meta fields configured on the site level. For instance, in the following scenario, the 'Level' and 'Country' meta fields are configured for user creation. The selected user meta field will trigger the action of adding users to the classrooms based on the classroom action conditions.
The fields shown are associated with that entity. You cannot add multiple conditions for the same field.
11. Based on the selected field, the conditional operator will be shown. For instance, for the 'Level' field, only the 'in' Select conditional operator will shown. Whereas for the 'Country' field, the '=' and '!=' Text conditional operators will be shown.
There are 4 kinds of fields, each of them have the following conditional operators:
1. Number
A number fields has a numerical input associated with three conditions: =, > or <. For example, if the field is Age, it will allow the user to specify Age > 25.
2. Text
This will have one of two conditions: = or !=, along with a text input field. This will allow the user to specify a condition, such as, Year = 2020.
3. Boolean
This will have two options shown as a radio button. For instance, Gender: ⚪ Male ⚪ Female
4. Select
This is the most commonly used field which has only one condition - in, with a multi-select input field. This multi-select field will have a list of options the user can select from.
12. Select the required level. You can select more than one level and the users of all the selected levels will be added to the classrooms as per the rule.
13. Similarly, you can add more conditions as per the available fields.
14. Click Add a new condition for adding users to classroom(s).
By default, the 'Role' and the 'Classroom types' action conditions will be present by default as mandatory action conditions. You can choose from the roles and classroom types configured on your site.
You need to have at least one action condition under the Action: Add users to classroom except the mandatory action conditions in order to save and create a rule.
15. Click the Select filter drop down.
16. Select the required field. The fields will be based on the classroom meta fields configured on the site level. For instance, in the following scenario, the 'Course', 'Level' and 'Department' meta fields are configured for classroom creation.
The fields shown are associated with that entity. You cannot add multiple conditions for the same field.
17. Select the required conditional operator (if more than one).
18. Then, select the required value of the field, in this case the required 'Department' of the classrooms to which users will be added. You can select more than one department and the users will be added to all the classroom with the selected departments as per the rule.
19. Similarly you can add more conditions to trigger the user addition to the classrooms with the matching conditions.
20. You can also remove the conditions, if required.
21. To understand the concept of rules better, let's create a rule - When any user(s) with 'Middle' level and 'Singapore' country meta fields are added on the site, they should automatically get added as 'learners' to classroom(s) which has the classroom type as 'classroom' and the department set as 'English'.
22. Click Save to save the rule. Any user added, with the matching trigger conditions, after the rule has been created will be added to the respective classrooms as per the action conditions.
23. Here, we are adding a new user named 'Ellen Hart' with the level meta field as 'Middle' and country meta field as 'Singapore'.
24. Once the user is created, she gets added to the classroom(s) with matching action conditions.
The rules created with 'User updated' trigger will be triggered only when a user profile is updated, corresponding to the trigger conditions, on the site.
1. Open the sidebar and click Manage Rules.

2. The Manage Rules page opens. Click Add Rule.
3. Add the rule title as per your requirement.
4. Click the Choose a trigger dropdown and select the User updated option.
5. As the 'User updated' trigger has only a single action - 'Add users to classroom', it will be selected automatically. Click Create rule.
6. The rule creation form open. Enter the rule description, if required.
7. Follow the steps 8-22 of the aforementioned article to add the required trigger and action conditions.
8. To understand the concept of rules better, let's create a rule - When any user(s) Level meta field is updated to 'IB' on the site, they should automatically get added as 'instructors' to classroom(s) which has the classroom type as 'classroom' and the course set as 'IB'.
9. Here, we are updating the 'level' meta of a user named 'James Decosta' to IB.
10. Once the user's profile is updated, he gets added to the classroom(s) with matching action conditions.
You can edit any existing rule and the changes will take affect immediately once you save the updated rule.
1. Open the sidebar and click Manage Rules.

2. Click the edit icon of the required rule which you wish to edit.
You can also click to expand a rule and then click the edit icon.
3. In the edit interface, you can update the name and description of the rule. You can also add or remove a list of conditions for the Action and Trigger criteria. Although, you cannot add multiple conditions for the same field.
You need to have at least one action condition under the Action: Add users to classroom except the mandatory action conditions in order to edit and save a rule.
4. Click Save to save the changes.
5. The rule will be updated and will come into effect immediately.
1. Open the sidebar and click Manage Rules.

2. Click the delete icon of the required rule which you wish to delete.
You can also click to expand a rule and then click the edit icon.
3. A confirmation message appears. Click Delete to confirm.
4. The rule will be deleted and the new users / updated users will not get added to the classrooms anymore as per the deleted rule.
Comments