Product: OneSync
Audience: ClassLink Administrator
This article details how to create collections by defining conditions. Collections are sets of users that will be exported to a destination. Conditions are logical relations based on user properties that select users for collections, custom mappings, groups, and events & actions in destinations.
Note: On the collections page under the Users tab in the Navigation Bar, the Destinations column will list what destinations that collection is being used in.
One collection can be applied to multiple destinations. When creating or editing a destination, you can select collections to export in the Select Users tab. There are two types of collections: automatic and manual.
Overview
Conditions
Conditions consist of a field, relation, and value. Fields are user properties such as name, company, or role. Relations are forms of logic used to compare fields and values and include:
- contains
- does not contain
- does not equal
- does not exist (no Value)
- does not match regex (SQL compatible Regex only, see below)
- ends with
- equals
- exists (no Value)
- greater than (numbers and dates only)
- is empty (no Value)
- is in sequence (values must be separated by commas)
- is not empty (no Value)
- is not in sequence (values must be separated by commas)
- is not numeric (no Value)
- is numeric (no Value)
- less than (numbers and dates only)
- matches Regex (SQL compatible Regex only, see below)
- starts with
You can use Regular Expressions in conjunction with conditionals for user collections, custom mappings, group mappings, and events & actions. To do so, select the relation "matches regex" in conditions. Note: You can only use REGEXP that are compatible with SQL queries, which are detailed below. These expressions include, but are not limited to:
- a = any value containing at least one letter a
- it|admin = any value containing either "it" or "admin"
- ^[a-d] = any value starting with a,b,c, or d
- ^[^a-d] = any value not starting with a,b,c, or d
- ^[a|d|g] = any value starting with a or d or g
- [a-d]$ = any value ending with a,b,c, or d
- ^...$ = any value as long as it's 3 characters long
- [0-9]{4}$ = any value ending with 4 digits
- [[:blank:]] = any value containing at least one space
Special Conditions
There are other conditions that are not strictly logic based. These conditions include:
- For All users: Selects all OneSync users.
- From Source: Selects a set of user based on the source that they were imported from.
- User in Collection: Selects all users in a collection.
- No Condition: Creates an empty manual collection. Users must be manually added to a collection based on this condition.
There are conditions based on the export action types for a user. These conditions include:
- Property Changed: Selects users if a specified property has changed. This includes cases where a property's value changes from null to non-null.
- User is Added: Selects newly exported users.
- User is Disabled: Selects users that are exported as disables.
- User is Enabled: Selects users that are exported as enables.
- User is Edited: Selects users that exported as edits.
Each destination also has a set of conditions that can be triggered by the incrementation of the destination-specific username-type. They can be applied as conditions for Groups and Events & Actions. According to the destination-type, these conditions include:
- Auto-Incremented containerName (Active Directory)
- Auto-Incremented sAMAccountName (Active Directory)
- Auto-Incremented userPrincipalName (Active Directory)
- Auto-Incremented primaryEmail (GSuite)
- Auto-Incremented userPrincipalName (Azure)
Automatic Collections
Automatic collections are created by setting conditions. You can define multiple conditions for a collection to select more specific sets of users. Together, these conditions will function on an "and" basis.
Note: When editing a collection to deselect users that were previously exported, this action will deactivate these users' links and/or disable the users in the destination based on your Advanced Options settings.
Manual Collections
Manual collections can be created in two ways.
- Create an empty collection by selecting No Condition. Then manually add users to this collection by navigating to the User's Profile -> Collections ->Add To Collection -> Save User. Or you can remove that user from collections that the user is already apart of.
- Convert an automatic collection to a manual collection. A collection is considered "manual" once you manually select a user to add to that collection.
Note: You must click Save User to confirm any changes to a user's collections.
Updated: Oct 2019