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, it's important to give your trigger a meaningful name.
3. Set trigger condition
At this point, define a condition that must be true before the desired action should be executed. The available conditions are:
|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|
Matches Regex supports capturing groups, allowing you to extract characters from a matching field and use them in another field. This is particularly useful for extracting GS1 data attributes from barcodes or an email address from an event badge.
We love regular expressions, so get in touch if you need any help.
4. Set 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 and see your trigger in action.
Questions about triggers?
We're always happy to help, chat with us live or drop us an email.