I've added a velo code automation with an event ticket purchase as the trigger. In the event options, guest are required to fill out one form per ticket.
It appears that the export const invoke = async ({payload}) => { // Your code here
}
is only called ONCE, but I need the form information for each ticket purchased.
Is there a way to get that from the payload? Or are there multiple payloads that I can access from a single call to invoke?
Thanks!
Eric
Thank you Eitan!
I'm very new to wix design and coding, and you're videos have helped me get ALL my custom coding complete - to include a custom members area and getting data to and from an Airtable!
Creating the events.js file and using the backend event was just what I needed.
Eric
Hi Eric,
I would start by adding a console log to get the value of payload once a purchase is made to see what data you have there to play with. 1. If you have all the tickets - you could just loop through them with the logic you need. 2. If you only have the order data, you may be able to retrieve the full order data with the tickets via a Velo API, then loop. An alternative approach could be to use the Wix Events backend events instead of Velo automations as I see you do have the ticket data there.
https://dev.wix.com/docs/velo/apis/wix-events-backend/events/on-order-confirmed
Hope that helps,
Eitan