Trigger Integrations from Logic

On our Business Tier, you can trigger integrations using Feathery's Javascript Rule Builder. This allows you to trigger these integrations at any point of your form and under any conditions that you set.

Here are the steps to trigger integrations:

  1. In the integration tab of your form, define an integration action (such as our Salesforce integration) using the Custom Logic trigger. An integration action is a single action for a given integration (ex: Create / Update for a certain object type in Salesforce)

  1. Then, once you press Save, an ID will appear at the top of the integration. You can copy that ID (or multiple IDs)

  2. Then, within a Logic rule, you can use the feathery.runIntegrationActions function to trigger the integration. The function takes in the following parameters:

    1. actionIds: string[]: an array of all the integration IDs that you want to run in order

    2. options: JSON with the following attributes:

      1. waitForCompletion: boolean. Sets whether you want the form to wait until the integration is done running before proceeding. If true, the form will wait. If false, the integration will run asynchronously and let the user continue in the form.

      2. multiple: boolean. Sets whether you want to be able to run this integration multiple times for a single submission. If set to true, you can run an integration multiple times. Otherwise, if false, a given action can only be run once per submission.

    3. Here is some sample code to trigger two Salesforce integration actions:

      let accountCreation = await feathery.runIntegrationActions(['b1802192-d7be-4432-9916-e62f17d8b23a','93b378b5-34ec-4ae3-a644-e160a79486c2'], {"waitForCompletion": true, "multiple": false} );

  1. Integrations triggered from Logic also support dependencies. For example, creating a Salesforce account and then a contact that is associated with that newly created account. For Salesforce actions, you can enable this by using the "Create or Update Record" Salesforce action, and then selecting the object type you want to create/update (ex: Contacts, Accounts, Custom Objects, etc). Then, under the "Linked Object Fields" section, you can see all of the related object fields for the chosen object type. You can link those related object fields to the objects created or updated by any other integration action.

    • To do this, in the field dropdown, there are options for ID - Action <Action_ID>. These map to any previously created Salesforce integration actions.

    • When you link these fields, then when this integration is run, it will reference the ID of the created Object associated with the action of the field.

  1. In the example below, I am calling two actions in order: b1802192-d7be-4432-9916-e62f17d8b23a ( which creates a Salesforce Account) and 93b378b5-34ec-4ae3-a644-e160a79486c2 (which creates a Salesforce Contact).

    • In the second action that creates the Contact, I have defined the Account ID field (found in the Linked Object Fields header) to link to @ID- Action b1802192-d7be-4432-9916-e62f17d8b23a. This means that the created Contact will be linked to the newly created/updated Account from the first action.

    • I then need to make sure I call these actions in the right order within my Logic rule. I need to ensure that the Action ID for the Create/Update Account action comes first before the Contact action.

    • Code Snippet: let accountCreation = await feathery.runIntegrationActions(['b1802192-d7be-4432-9916-e62f17d8b23a','93b378b5-34ec-4ae3-a644-e160a79486c2'], {"waitForCompletion": true, "multiple": false} );

Last updated