Overview
The Alchemer 'Run custom JavaScript' tool is a built-in integration that allows organizations to run custom JavaScript within an Alchemer workflow to transform data, apply business logic, and return calculated outputs.
This integration supports executing custom JavaScript during workflow execution. The integration allows Alchemer to process survey and workflow data, personalize workflow paths, enrich routing logic, create merge codes, and return dynamically generated outputs without manual intervention.
Common uses for the Alchemer Tools integration
- Transform or normalize survey data using custom JavaScript
- Apply conditional logic that exceeds standard workflow rules
- Generate calculated values or derived fields
- Prepare or format data for downstream integrations
- Return structured outputs for use in workflow routing and merge codes
What can the 'Run custom JavaScript' integration do?
- Execute custom JavaScript
- Read workflow and survey data
- Return calculated or transformed outputs
- Expose returned values as workflow metadata
You will need
-
An Alchemer plan that includes integrations and the Integration Manager permission enabled.
- Contact us if you are unsure if your plan includes integrations.
Setup 'Run custom JavaScript' integration in workflow
Alchemer Tools |'Run custom JavaScript'
You will need:
- Basic JavaScript knowledge
- Workflow data to process
Configure the action
- Open your workflow in Workflow builder.
- Drag and drop the Tools & Utilities integration into the workflow.
- Click the pencil icon to configure the action.
- Select Tools | Run JavaScript.
- Tools | Run JavaScript: Define the variables that your script will return. These will be use to create your output merge codes.
- Tools | Fields to use: Select the fields in this workflow that contain the values you want to use in your script.
- Tools | Construct script: Build out your script. You will need to return an object with key value pairs using the defined variables from the previous step as your keys. You can also include merge codes from the 'Merge code list' in your script which will return the value for that field during integration execution.
- Save the action.
Status codes
- 200: Script ran successfully
- 400:The external integration returned an error
Testing and Validation
How to test
-
Trigger the workflow and monitor runs in the Monitor tab.
- Review returned outputs in the workflow metadata.
- Confirm outputs match expected results.
How to verify results
- Inspect returned metadata values.
- Use outputs in routing, conditions, or merge codes.
Monitoring Integration Activity
Where to find logs
- Go to Results → Monitor.
- Select the Tools integration step.
What logs display
- Script inputs and outputs
Troubleshooting
Script errors
- Syntax errors in JavaScript
- Undefined variables or missing inputs
Output issues
- Returned values not defined
- Unexpected data types
FAQs
What permissions do I need?
Integration Manager permission in Alchemer.
Integration Manager permission in Alchemer.
When does the integration run?
When the workflow reaches the Tools integration step.
When the workflow reaches the Tools integration step.
Can I use multiple Tools actions in one workflow?
Yes. Each Tools action runs independently.
Yes. Each Tools action runs independently.
Why isn’t my script returning data?
Check the script logic, ensure return values are defined, no syntax errors are present, and the object is properly formatted.
Check the script logic, ensure return values are defined, no syntax errors are present, and the object is properly formatted.
What if I need additional functionality?
Contact Alchemer Support for enhancement requests.
Contact Alchemer Support for enhancement requests.