Question:
How to Automatically Sync Events from Wix Events App to a Custom CMS Collection Using Velo
Product:
Wix Studio Editor, Wix Events App, Velo Code
What are you trying to achieve:
I am building an automated, scalable system in Wix Studio where non-technical users can manage events, RSVPs, payments, and user interactions using Wix’s built-in apps and a custom CMS structure.
My goal is to automate the process of syncing event data from the Wix Events App to a Custom CMS Collection. Since Wix Automations has limitations, I am trying to use Velo code to fetch events from Wix Events App (Events/Events) and store them in a Custom Events CMS collection.
Core Objectives:
- Fetch events from the Wix Events App (Events/Events) when an event is published or updated.
- Store this data in a Custom CMS collection (CustomEvents) so that it can be used for further automation and filtering.
- Ensure that events are not duplicated in the CMS collection by checking if the event already exists before inserting new data.
- Maintain data consistency by keeping event details, start/end dates, locations, and other attributes updated in real-time.
- Use Velo instead of Wix Automations, as Wix Automations has limitations in handling complex workflows.
What have you already tried:
- Querying Events/Events Collection using:
javascript
CopyEdit
wixData.query(“Events/Events”).find()
- This returned no data despite having events in Wix Events App.
- Wix Support confirmed that Events/Events is a read-only system collection and should be queried directly.
- Using Wix Events V2 API (wix-events.v2)
javascript
CopyEdit
import { events } from ‘wix-events.v2’;
events.queryEvents().find();
- This API does not return event details from the Events App as expected.
- Using Wix Backend APIs (wix-events-backend)
javascript
CopyEdit
import wixEvents from ‘wix-events-backend’;
wixEvents.getEvent(eventId);
- This API requires an event ID to fetch details but does not provide a way to retrieve a list of events.
- I was unable to fetch all events dynamically without manually providing an event ID.
- Trying wixData.insert() to Save to Custom CMS
javascript
CopyEdit
wixData.insert(“CustomEvents”, eventData);
- Since Events/Events is read-only, I attempted to copy event data into CustomEvents but was unable to fetch data correctly.
-
Verifying Wix Permissions
- Confirmed that the Wix Events App has read permissions for anyone but does not allow modification.
- Custom CMS collections have read/write permissions enabled.
-
Testing Different Triggers & Automations
- Used Wix Automations (Event Published as a trigger), but it did not allow writing event details into a CMS collection.
- Tried using Velo backend functions but still unable to extract the list of events.
Current Issues & Questions:
- How can I programmatically retrieve all events from Wix Events App?
- Is there a way to fetch all event data and store it into my Custom CMS?
- Is Events/Events the correct collection to query, or does Wix provide another API for bulk event retrieval?
- How can I automate event updates so that changes in Wix Events App reflect in my CMS?
- Is it even possible to achieve this automation entirely through Velo, without Zapier or third-party tools?
Additional information:
- I am using Wix Studio Editor.
- I have enabled Velo Developer Mode and tested backend API calls in events.jsw.
- My CMS structure consists of Custom Events, Users, RSVPs, Payments, Workflows, and Tags collections.
- The goal is to ensure all event-related data is manageable within the CMS, so non-technical users can interact with it without dealing with the Wix Events App directly.
Final Question:
Given the above limitations of Events/Events and Wix Automations, is it possible to fully automate syncing events from Wix Events App to a Custom CMS Collection using Velo?
If yes, what is the correct method to fetch and store event data dynamically?
Looking forward to any guidance or best practices.