Rules: THEN Types
This type of rule can be used on its own or in conjunction with Rules: IF Types. THEN type rules make use of multiple different functions or "Types". This article will outline each of those types with a brief description of what each one is.
There are some THEN type rules that do require an IF type rule to function and those rules will be outlined in this article.
Types of THEN Rules
The first thing to note, is that if there is no IF statement in your rule, then your THEN portion will always execute. The IF statement sets additional criteria that needs to be met in order for the THEN statement to be executed.
- Concat: Add a payload's field (value), add the separator then add the payload's second field (target) and set the field to the final.
- Math: Set the operator to one of (add, sub, multi, div). Returns field <Operator> value.
- dateSetWeekday: <Source> is the starting date, if unset it uses the current date. <Value> is what day of the week you want to set the date to. <Operator> is after/before based on if you want to go to the next/previous occurrence of that day.
- dateMath: Set the operator to either add or sub. Sets field to the date in <Source> offset by <Value> day/s. If <Source> is unset, then the current date is used. <Value> can optionally be set to "duration" to use reqDetails.duration.
- regexReplace: Items that match the regex are replaced with the specified <Value>.
- Truncate: Truncate the field to a given length, with optional "omission" characters added at the end.
- Replace: Set the field to the value of the given field.
- setClientData: Replace the payload's client data with the value.
- This is used to change the ‘Client Data’ field on the credential.
- This is usually requested when a customer has a VMS setup for a specific client/buyer but then additional clients/buyers start feeding positions through that VMS.
- Changing the "Client Data" based on the "Company" is usually what this is used for to account for multiple clients/buyers coming through one "dedicated" VMS account.
- setIgnore: Set the position ruleIgnore to true.
- setTo: Replace the payload's field with the value.
- template: Set the field to an EJS template evaluated from the given value.
- This is one of the more complex rules as EJS stands for "Embedded JavaScript".
- This allows you to build rules using EJS.
- A typical example would be adjusting the description of jobs to pull in additional fields from the payload.
- When creating a new template, it is best to find one that was already created and use that as a guideline to build out your own rule.
These are arguably the most difficult types of rules to build because you are coding it out yourself and one wrong character can break the rule. Referencing a pre-existing template rule will help greatly in building your own.
- atsGetCompanyField: Copy the value of a field from the ATS company into a field on the position.
- atsGetParentCompanyField: Copy the value of a field from the ATS company's parent into a field on the position.
- atsGetUserFromCompany: Look up a user from a field from the ATS company, and put their ID into a field on the position.
- atsSetOwnerFromCompany: Set the position owner to the user named in a field on the ATS company.
- atsSetOwnerFromDepartment: Set the position owner to the default owner of the ATS department.
- atsEmailUsersFromDepartment: Add all users from the ATS department to the notification email list.
- atsGetCustomObjectField: Copy the value of a field from a given custom object into a field on the position.
- atsGetContact: Optionally set source to the field containing the contact name and field to the ATS field we will set.
Was this helpful?
No