isOpen: true, pages: 1

Getting Started with CustomJS

This guide will walk you through everything you need to know to start using CustomJS with Microsoft Power Automate, from initial setup to running your first successful automation.

1. Register and obtain your API key

To setup, you need to create an account in customJS. This will allow you to authenticate your requests to the customJS API.

  1. Visit https://www.customjs.space and click Sign in.
  2. Complete registration by either providing your email and password or using your Google account.
  3. Once registered, you will be redirected to the customJS app dashboard. Click Show under API Key to reveal your API key.
    CustomJS V2 API Key
    CustomJS V2 API Key
  4. Once fetched, copy the API key.

2. Use CustomJS in Microsoft Power Automate

  1. Go to Microsoft Power Automate and open your flow.
  2. Add a new action and search for Custom JS connector, then select Execute inline JavaScript Code.
    CustomJS Power Automate Actions
    CustomJS Power Automate Actions
  3. Click Create Connection.
  4. Enter a connection name and paste the API key you copied earlier. Click Save.
  5. Enter your JavaScript code, input, and select return type. Click Save to finish setting up your action.

3. Your first successful test

Run a simple test to make sure everything is working correctly:

  1. In the JavaScript Code field, enter:
return {
  message: "Hello from CustomJS!",
  timestamp: new Date().toISOString(),
  success: true
};
  1. Leave the Input field empty for now
  2. Set Return Type to Object
  3. Click OK to save the action
  4. Run your flow to test the connection. You should see an output like:
{
  "message": "Hello from CustomJS!",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "success": true
}

If you see this output, congratulations! Your CustomJS integration is working correctly.

Quick troubleshooting

In case you have any issues, here are some common troubleshooting steps:

Connection issues
  • "Invalid API key": Double-check your API key is copied correctly
  • "Connection failed": Verify you're using the correct CustomJS endpoint
  • Connector not found: Ensure you selected "CustomJS" custom connector
Code issues
  • No output: Check that you have a return statement
  • Unexpected results: Verify your return type matches your data
  • Timeout errors: Keep code execution under 60 seconds per request
Getting help

If you encounter issues:

  1. Review your code for common mistakes above
  2. Test with simple examples first
  3. Contact support if problems persist