You can write your own JavaScript to implement hooks, filters, and data transformation. You can organize scripts to fit your needs, such as placing a single hook or multiple functions within a shared script. Always be aware that a script can be referenced by multiple integration resources, which means that a change to one import’s hook could affect another import’s code, depending on how you organize your account.
Tip
Using resource aliases makes scripts easier to maintain.
Note
When you save a script, it is stored in an environment-specific location (Sandbox vs. Production). If you create a script in the Sandbox environment, you will not have access to that script in the Production environment (and vice versa). You can duplicate scripts between environments by cloning an integration that references the script.
-
Sign in to integrator.io and expand the Resources section of the left navigation menu.
-
Click Scripts.
-
At the top right, click + Create script.
-
Enter a name and a description for your script. Give your script a name that will make it easily recognizable to others working on your integration.
-
Click Save & close.
-
Click the script’s Actions overflow (...) menu and select Edit script.
-
You can modify the script in the Edit content section or expand it for the full Advanced field editor.
-
Click Save.
Use the following steps to create a preSavePage export hook script:
-
Open a flow, click + on the source application, and click the hook icon.
-
For Hook type, choose Script or Stack depending on where you want to store the script.
-
In the Pre save page section, enter the pre save page function name as defined in the script. You can select an existing script from the Scripts drop-down menu or click the pencil icon to write a new script.
Note
You can leave the function name blank if there is only one function in the selected script. However, if the selected script contains two or more functions, you must provide the function name to be executed; otherwise, the first function present in the script automatically populates as the function name.
-
Click the pencil icon beside the selected script to open the Script editor where you can preview the data input and output and perform any modifications to the code if required.
-
Click Save & close. This script will be executed after the export and before the import.
Use the following steps to create a pre map, post map, or post submit import hook script:
-
Open a flow, click + on the import step, and click the hook icon.
-
For Hook type, choose Script or Stack depending on where you want to store the script.
-
In the Pre map, Post map, or Post submit section, enter the function name as defined in the script. You can select another script from the Scripts list or click the Edit () button to code a new one.
Note
You can leave the function name blank if there is only one function in the selected script. However, if the selected script contains two or more functions, you must provide the function name to be executed; otherwise, the first function present in the script automatically populates as the function name.
-
Click the pencil icon beside the selected script to open the Script editor where you can preview the data input and output and perform any modifications to the code if required.
Comments
When you click on the context menu to edit the script, it's not "Edit Script", but "Edit Script Content"
Please sign in to leave a comment.