Reusable Logic Configs
Define globally available logic configurations to use in your Javascript logic rules
Last updated
Was this helpful?
Define globally available logic configurations to use in your Javascript logic rules
Last updated
Was this helpful?
If you have variables or configuration that are too large or complex to define in your rules directly, you can leverage configs to define that information for your rules to access in an efficient way.
To set up a config, navigate to your form logic rules and click on the Settings button. This will open a pop-up that gives you an option to upload your config in CSV format. A typical workflow is:
Define your configuration in a spreadsheet (e.g. a list of stores by region, list of activities by time, etc). Make sure the first row of your CSV is a list of column headers.
Export the spreadsheet to a CSV and upload it to Feathery.
Feathery automatically stores and indexes your uploaded data, making it available to efficiently query from your rule itself. The data is formatted as an array of objects, where each object is a row of the spreadsheet that maps from a sepcific header to the value for that specific row and column.
To use a config in your logic rule, you can leverage the feathery.getConfig({filter, keys, unique})
method in your rule.
filter
: A map from spreadsheet headers to the values that rows being returned must contain. If not specified, all config values will be returned.
keys
: A list of spreadsheet columns to be returned. If not specified, all columns will be returned.
unique
: Only return spreadsheet rows with unique sets of values to be returned.
Make sure to await
the promise returned from the method to get the actual values to use.