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.
To setup, you need to create an account in customJS. This will allow you to authenticate your requests to the customJS API.
Visit https://www.customjs.space and click Sign in . Complete registration by either providing your email and password or using your Google account. 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 Once fetched, copy the API key. Go to Microsoft Power Automate and open your flow. Add a new action and search for Custom JS connector, then select Execute inline JavaScript Code .
CustomJS Power Automate Actions Click Create Connection . Enter a connection name and paste the API key you copied earlier. Click Save . Enter your JavaScript code, input, and select return type. Click Save to finish setting up your action. Run a simple test to make sure everything is working correctly:
In the JavaScript Code field, enter: return {
message: "Hello from CustomJS!" ,
timestamp: new Date (). toISOString (),
success: true
};
Leave the Input field empty for now Set Return Type to Object Click OK to save the action 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.
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 endpointConnector not found : Ensure you selected "CustomJS" custom connectorCode issues No output : Check that you have a return statementUnexpected results : Verify your return type matches your dataTimeout errors : Keep code execution under 60 seconds per requestGetting help If you encounter issues:
Review your code for common mistakes above Test with simple examples first Contact support if problems persist