Is it possible to sync items from Sandbox to the Live version of the collection using code, rather than manually clicking in the Collection?

Question:
I have a collection of items in the sandbox version. I would like to automatically sync them to the live version of the collection when certain conditions are met. How do I do this in Velo?

Product:
Wix Studio Editor

Looking to automatically update your Wix Data collection based on certain conditions?

The good news is that you can focus solely on your live collection for this! You can actually cancel your Sandbox in the Wix dashboard if you don’t need it for testing purposes.

Here’s how to achieve automatic updates using Velo directly in your live collection:

Velo Code Approach:

  1. Live Collection and Triggers: Work directly with your live Wix Data collection. Set up triggers to fire when the desired conditions are met (e.g., user submits a form, specific date is reached).
  2. Velo Script: Within the trigger, write a Velo script to update the collection items based on the trigger criteria. Use Wix Data API functions like wixData.update or wixData.create to modify collection items.

Here are some resources to get you started:

Important Note:

While this response provides a solution using Velo code, it’s important to understand that use code to synchronizing data between Sandbox and Live collections is not a common request

Hi! Thank you for your response. I appreciate the suggestion.

I need to keep the sandbox collection for testing purposes. Different items in the sandbox collection are at various stages of testing, and they need to meet specific criteria before syncing to the live collection. Also, does canceling sandbox cancel the feature across the site? If that’s the case that won’t work either. Other collections use sandbox as well.

canceling the Sandbox affect all CMS collections across the site .