The Automations Action service plugin lets you develop custom actions directly in your site dashboard. To use a custom action as part of an automation, start by creating a new automation in your site dashboard:
Go to the Automations page in your dashboard.
Click New Automation, then Start from Scratch to open the automation builder.
Select and configure a trigger.
Click the + to add a step and choose Action. In the menu on the left, select Run Velo code.
Click Start Coding to add your code. You'll be prompted to create a new code file.
Give the file a name and click Create & Start Coding.
You should now see something like this:
The Write Velo Code modal contains two tabs. The first is the .js file where you write your code. The second tab, which appears under Payload view, lets you view the expected structure of the trigger payload.
When you finish writing your code, click Save.
Now that you have set up and coded your custom action, you can activate the automation immediately. However, we recommend testing the action code first.
To test your code, follow the instructions under Run your code to test this action, then click Run Code.
Wix provides sample data that matches the structure of your trigger payload. You can edit any of the fields in the sample payload to test your action.
Be aware that testing the action runs the code live on your site, and may change cause changes in the site or dashboard.
Once you test your code and are sure your action works, activate your automation.
To edit your action code, edit your automation and select the Run Velo code action, then click on Edit Code. Make the changes you want, save the code, and test.