JavaScript Code
Using JS libraries
Variables
Built-in variables
// result of the previous step
return {{data}};
// error response of the previous step
return {{error}};
// incoming action params, passed in by components,
// the Execution/Loop action steps or when calling the action from the code
return {{params}};
// the response of the request, if the Code step follows an HTTP API step
return {{res}};Using variables
Optional chaining and default values
Using variables inside strings
Data transformation
Component values & methods
Merging data
Merging results of multiple steps
Calling and merging data from other actions
Custom validation
Debugging errors
Useful examples
Map data for the select component
Add a "Not Selected" option at the beginning of the array
Add color to the Select dropdown items
Refresh action data at a certain interval
Safely parse JSON result into a variable
Last updated
Was this helpful?