Using Custom Fields in Scripts

Custom Fields are a great method to create unique configurations for a specific component. This becomes very powerful when scaling your integrations and creating component templates with unique custom fields configured for each deployment.

In your Translator scripts, you can programmatically:

component.fields() to access a lua table of all configured custom field names and values.

Here, we are storing our custom fields key value pairs in a variable called configs that can bw call in the script to pass configuration values like the database name we are connecting to.

component.setFields{} can be used to automate creating a custom field name and value. For example, when querying an API or Database, you can store particular as custom fields.

Here, we are querying a weather API and storing the current temperature as a custom field.

 

Â