Wix Automations: Using the Run Velo Code Action

2 min read
Velo is Wix's full-stack development platform. Select the Run Velo Code action to enhance your automation using your own Velo code. Write your code, then run it to test, and then activate the automation.

With this automation action and the Velo APIs, you can customize your site or business in any way you like, for example, by updating your CMS, formatting data, or connecting to third-party applications. Learn more about using Velo.
Before you begin:
  • In order to use the Run Velo Code action, you must first enable Velo.
  • The custom extensions feature currently can’t be added to a site when using Git integration and Wix CLI. You need to have permission to publish the site and the site must be published.

To use the Run Velo Code action:

  1. Go to Automations in your site's dashboard.
  2. Start creating your automation by choosing your trigger in the Trigger section and selecting Run Velo Code in the Action section.
  3. Click Start Coding
  1. Write your code in the window that opens.
    Note: 1. Lines 2 - 6 support the autocompletion system. Make sure you keep it in your code file. 2. Use the "Invoke" function to implement your action logic.
  1. You can use the data from the trigger or other parts of the automation by employing:
1payload.my_field
  1. You can view the payload specification by clicking Payload View.
  1. Save your code to integrate your custom logic in this automation.
  2. Before activating your automation, run your code to test it and make sure it gives the results you expect. Before you start your test:
    • Define the sample data that will run in the test.
    • Open your site logs to monitor the result.
Important:
Running your code to test it means it's running live, so might make changes within your site and/or dashboard.
  1. When you're happy it's running correctly, click Activate to activate your automation.
Notes:
  • You can edit the Run Velo Code action to work in your neutral code environment. Only editing is possible from the VS code and Velo editor environments. Learn more about custom extensions.
  • If you connect to a third-party provider using SPIs, you agree to the Wix.com Terms of Use. Wix is not responsible for your use of such a third-party provider, and any liability resulting from such use will be your responsibility.
  • Need help implementing an SPI? Find a professional to help you.

Did this help?

|