Code Component

Author and run your own code
Component key: code#
DescriptionThe code component allows you to write your own short snippets of JavaScript code, and is handy for writing quick functions or data transformations that are specific to your product or industry. Please see the full article on the code component for information on when a code component is appropriate, and common use cases for a code component.
Code component steps should be succinct and integration-specific. If the code you write could be reused in other integrations, if it needs to handle credentials, or if the code is complex enough that it would benefit from unit tests, etc., you should write a custom component instead.
For some examples of code component usage, check out these quickstart guides:
#
Code Connections#
API KeyInput | Notes |
---|---|
Input API Key string / Required apiKey | Notes API Key |
#
API Key SecretInput | Notes |
---|---|
Input API Key string / Required apiKey | Notes API Key |
Input API Secret password / Required apiSecret | Notes API Secret |
#
OAuth 2.0 Authorization CodeInput | Notes |
---|---|
Input Authorize URL string / Required authorizeUrl | Notes The OAuth 2.0 Authorization URL for the API |
Input Client ID string / Required clientId | Notes Client Identifier of your app for the API |
Input Client Secret password / Required clientSecret | Notes Client Secret of your app for the API |
Input Headers string Key Value List headers | Notes Additional header to supply to authorization requests |
Input Scopes string scopes | Notes Space separated OAuth 2.0 permission scopes for the API |
Input Token URL string / Required tokenUrl | Notes The OAuth 2.0 Token URL for the API |
#
Basic Username/PasswordInput | Notes |
---|---|
Input Password password / Required password | Notes Password |
Input Username string / Required username | Notes Username |
#
OAuth 2.0 Client CredentialsInput | Notes |
---|---|
Input Client ID string / Required clientId | Notes Client Identifier of your app for the API |
Input Client Secret string / Required clientSecret | Notes Client Secret of your app for the API |
Input Headers string Key Value List headers | Notes Additional header to supply to token requests |
Input Scopes string scopes | Notes Space separated OAuth 2.0 permission scopes for the API |
Input Token URL string / Required tokenUrl | Notes The OAuth 2.0 Token URL for the API |
#
Private KeyInput | Notes |
---|---|
Input Private Key text / Required privateKey | Notes Private Key |
Input Username string / Required username | Notes Username |
#
Triggers#
Code Block TriggerAuthor and run your own code as a trigger | key: runCodeTrigger
Input | Default | Notes |
---|---|---|
Input Code code / Required code | Default
| Notes The code to be executed |
#
Output Example Payload{ "payload": None }
#
Actions#
Code BlockAuthor and run your own code | key: runCode
Input | Default | Notes |
---|---|---|
Input Code code / Required code | Default
| Notes The code to be executed |
#
Output Example Payload{ "data": null}