Add conditional logic to your sheets using Triggers
Triggers allow you to add if-this-then-that logic to sheets, to do things like:
- Show or hide fields based on the value of other fields
- Update one field based on the value of another
- Get an email when a product is damaged or stock levels are low
- Split barcode data such as GS1 or VCard into different fields
Each trigger is made up of:
- Condition = what must be true for the condition to be met
- Action = what should happen when the condition is met
1. Open sheet triggers
Open sheet Triggers and click Add trigger.
2. Give your trigger a name
For maintainability, give your trigger a meaningful name. Ideally a name that reflects the purpose of the trigger, such as Extract email address.
3. Set a trigger condition
Define a condition that must be true before your desired action should be taken. This could be something like, when Condition (dropdown) equals Damaged or stock is less that 3.
|Is empty||Field contains no value|
|Is not empty||Field contains any value|
|Contains||Field contains a particular set of characters|
|Does not contain||Field does not contain a particular set of characters|
|Starts with||Value starts with 'x'|
|Does not start with||Does not start with 'x'|
|Ends with||Ends with 'x'|
|Does not end with||Does not end with 'x'|
|Equals||Field contains the exact value|
|Does not equal||Field does not contain the specified value|
|Is less than||Value is less than number provided|
|Is greater than||Value is more than number provided|
|Matches Regex||Field value matches a Regular Expression|
|Contains GS1 AI||Field value contains a GS1 Application Identifier|
You can use a Regular Expression (also known as RegEx) to perform an action when any of the fields contain a particular set of characters. You can also use RegEx capture groups and the Set value action to move parts of that data into another field.
We love Regular Expressions, but they can be tricky, RegEx 101 is a great tool to use when writing and testing your expressions, but if you need help please get us a shout.
Contains GS1 AI
GS1 (also known as Global Standards 1) is an international standards organization that help define a series of standards for how information is encoded within a barcode. These globally adopted standards help computer systems around the world make sense of physical objects as they move through supply chain.
The Contains GS1 AI condition can be used to preform an action when a barcode contains a specific GS1 Application Identifier. When used in conjunction with the Set value action, values such as serial number, expiry date etc can be extracted from a GS1 barcode and moved into a relevant field/column.
4. Set a trigger action
A trigger action can be thought of as what you want to happen when the defined condition is met. At present, the possible actions are:
|Show||Show the selected field when trigger criteria is met.|
|Hide||Hide the selected field when trigger criteria is met.|
|Set value||Apply custom value to selected field when trigger criteria is met.|
|Clear value||Clear the value of the selected fields when trigger criteria is met.|
|Set required||Set a field to required when trigger criteria is met.|
|Clear required||Remove required status from a field when trigger criteria is met.|
|Notify me||Email account holder when trigger criteria is met.|
If you'd like us to add something else to the list, please let us know.
5. Save the changes
Finally, save the changes and you're done.
You can now scan a barcode, or enter data and see your trigger in action.
Questions about triggers?
We're always happy to help, chat with us live or drop us an email.