Advanced Logic & API Connections
Have total control of your form at specific interaction points, including submissions, errors, and more.
Last updated
Have total control of your form at specific interaction points, including submissions, errors, and more.
Last updated
Advanced logic is a powerful way for you to run custom rules at critical moments when the user interacts with your Feathery form. They allow you to completely control and modify the default behavior of the form.
You configure these rules to run on certain events, such as when a step of your form is loaded, a step is submitted, a field value is changed, and more. The events available here are the same ones available to the embed SDK.
The custom logic feature is available via the Logic
tab in the dashboard. You can add, modify and delete custom logic rules.
You can edit a custom logic rule by selecting it and either configuring our visual rule builder or adding custom JavaScript for advanced use cases.
With the convenience of the visual rule builder, you can configure the logic of your rule without needing to know how to code.
The rule builder exposes a visual interface that allows you to choose when the rule should run, if it should run, and what should happen when it does run. Actions such as setting the value of a field, connecting to an API, opening a URL, and more are possible. It also supports an expression builder for setting up calculations and field value transformations.
Once you save your changes, the rule builder will automatically convert your rule to JavaScript code that can be seen in the "Code Editor" tab.
It's important to note that each rule is either built using the visual rule builder or with JavaScript. You can switch which method is used at any time. However, you cannot use both at the same time on a single rule.
Read more about building rules using the visual rule builder here.
The visual rule builder is limited when it comes to advanced logic such as nested conditions, advanced calculations, etc. Using JavaScript allows you to have more control over your rule's logic.
Read more about building rules in JavaScript here.
By default, your rules will only have access to fields on the current form or hidden fields. However, you can turn on access to fields on other forms by enabling Enable all form fields
at the top of your list of rules. Note that this may potentially cause performance issues if you have a lot of forms and fields.
The rule logic you define will run on your end-user's browser. You may want certain network requests in your rule logic to be performed from Feathery's servers instead for security reasons. This can be done with API Connectors.