Articles in this section

Create custom settings & access them in integrator.io forms

Custom settings allow you to define additional attributes on resources that can then be accessed within the logic of your flows.

Custom forms allow users of your resources to control the values of these custom settings in convenient forms that can be extended with scripts. Custom forms give less technical users the ability to easily configure flows to suit their needs.

Defining custom settings

You can define custom settings for the following resource types:

  • Integrations, via the Settings tab

  • Flows, via the settings_gear.svg Settings pane

  • Connections, exports, and imports, via the Custom settings section of their respective forms

Settings can be defined only for resources to which you have Manager (write) access, and when you are in Developer mode. Once settings are defined and a custom form is built for those settings, then any user with Manager access can modify the values for those settings.

Specify simple custom settings

You can define settings by entering valid JSON objects into the Settings editor. In this example, we are introducing two fields to the settings of an integration:

custom-forms-1.png

Similarly, in this example, we are adding a field to a flow within an integration:

custom-forms-2b.png

Using custom settings in flows

As mentioned above, integrator.io allows you to define settings for all of the key resource types. The settings on each resource are independent, which means that – for example – the settings on a flow can’t be defined in terms of the integration that the connection is used in.

Scope of settings

Custom settings are available for each integration and its resources: flow, connections, exports, and imports. Because of the relationship between these objects, custom settings are cumulative, and integrator.io makes it easy for you to access settings from the various scopes.

For example, when working on a hook for an export in a flow, you will have access to the settings for:

  • The export itself;

  • The flow the export is a part of;

  • The connection that the flow uses; and

  • The integration that the flow belongs to

Where available, you will find settings as an object at the same level as the actual flow record data itself. For example, to continue the example from the previous section, notice the settings object below and the way in which the individual integration and flow setting attributes appear within it:

360061156192-custom-forms-3.png

Using settings to change flow behavior

Once you have defined settings, you can use them to change the behavior of your flows. You can currently access the settings object in filters, transforms, and hooks.

  • Filters: the settings object is available in both the rules and script-based filter. In the rules-based view, notice that all settings appear in the drop-down list for the second operand.

360061157852-custom-forms-4a.png
  • Transforms: the settings object is available only in the script-based transform, which means you can refer to elements of the settings object using the regular JavaScript dot notation.

  • Hooks: the settings object is available, at present, in most hooks.

Using settings in mappings

Custom settings are currently not available for import mapping and response mapping. In order to work around this limitation, we recommend you copy any settings that you would like to use in mapping into the flow data itself before the mapping step, ideally as part of a preMap hook.

In this example, we are copying the region attribute from the flow settings back into the data so that it can be used in the mapping step:

360061158952-custom-forms-5.png
Was this article helpful?
3 out of 3 found this helpful

Comments

8 comments
Date Votes
  • Is it possible to use Custom Settings in an Export's SQL query? When I reference a custom setting in a query, then preview the query, I receive the error: "Cannot read property 'xxx' of undefined", where 'xxx' is the name of the Custom Setting.

    1
  • Having the exact same issue!! trying to use setting as a schema override (dev/prod) not working

    1
  • Sorry for the delay, Josh Saterdalen and Anthony Rosenkrantz. (I mistook the autonotification on your comments as Community forum requests.) Assuming you haven't done so already, I'm going to submit these questions to our support queue and track the answers as they try to reproduce and then find another solution or escalate to the product team. 

    0
  • i put a work around in my flows to get the settings and stash them in the payload. so when i run postgres connectors i have the settings. (not great solution)

    0
  • How would you go about updating the custom setting after each run? For example, if I set one up as a counter and I want the counter to increase after each successful flow run. How would I do that? Thanks! 

    1
  • Hi, Shubham Kaila. That's a great question, which I'm surprised we haven't seen yet. 

    The official answer is that it's not supported right now. Custom settings are static (read-only). Keeping tally of successful runs is best done through your dashboards/consoles and logs.  

    If you wanted to automate it, perhaps you could increment a value in a custom record or upload a file in an import at the end of your flow. 

    0
  • I defined settings on a flow group and hoped it would create a hierarchy based on the flow group name, instead it puts them in a generic settings.flowGrouping property. Bummer.

    Maybe I'm not thinking about flow grouping correctly, but what is the point of settings on a flowGroup? How is it different than settings at the integration level? Is there different behavior in some way for these two:

    settings.integration...
    settings.flowGrouping...

    0
  • Steve Klett - Thanks for posting. It would be interesting to understand your use case to learn. I am assuming you're trying to access some of these settings through your bubbles/flow. That particular flow might be belonging to one of the flow groups. In this case you would see the settings defined for that flow group which is "ftp_file_prefix". Were you expecting to see the settings defined for all flow groups in which case you may want to see that hierarchy that exist ? We would like to know and understand what can be accomplished with that sort of behaviour. 

    0

Please sign in to leave a comment.