How to Add an Item to a Data Collection with WiX Code | WiX Data API - .insert() Method | Velo

preview_player
Показать описание
In this series I walk you through the long await WiX Data API!

The WiX Data API allows you to interact with data collections using code (Velo). With just a few lines of code you can get, add, remove or update items in your collection. You can also do more complex things such as querying a collection based on a certain field - value pair, using hooks to take action before or after a collection is changed and more!

In this video I talk about the .insert() method which allows you to add a new item to a collection using code.
See the full documentation here:

Have questions? Need something fixed on your website ASAP?

Join my private Facebook group:

Join a free group consult:
Рекомендации по теме
Комментарии
Автор

Thanks for the video. What would be the reason that the collection is not being updated? Can this only be done with Wix Form Collections or can if be done with custom ones? I am trying to update a custom one and it is not working. I am getting the console.log data but it isn't putting into the collection - Thanks!

TimCGI
Автор

Great video as always, thank you so much! Just one question. Wouldn't setting the add permission to 'Anyone', create a vulnerability for someone to fill the database with junk? I am creating an Orders database, and something like this would be detrimental…

thanasissld
Автор

Hi! In Wix how to insert pdf to collection by upload button? If in the collection has one column's type is document. I tried by velo but only in the column information of the pdf is added instead of the pdf itself.

AEC---
Автор

very nice explanation !! just wanted to ask is it possible to not insert data in the database if the data already exists. Let say we have name and email as a field now I enter a name and email which already exists in the database so now a message will show up data already exist?

wizzard
Автор

Great video, but one question, where the } from the $w.onReady(function() { its closed? I cant see it

Poisoned
Автор

Thank You for the great video! One question I have is how to I add a new item to the collection but as a number and not text (I think it has something to do with .value). I am trying to record data so I can do calculations with it but it doesn't work as my data is not saved for example as 1 its it "1"

ErikUlmer
Автор

Hi, thqnk you very much for this tutorial ! After inserting a new database input I would like to have my repeater linked with my dataset to refresh after inserting, but impossible for me to find a solution about that without having to refresh the page... any idea ? :)

xxKiLeUr
Автор

This was very helpful, but I'm running into an issue. I'm trying to insert an item into a dataset that already exists, but I'm getting this error: Error: "WDE0025: The [collectionName] collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor." I'm confused because it definitely exists, am I not accessing it right or something?

taylorklone
Автор

Great! How can I display data in another page on site? Can you help me?

CornerXoan
Автор

How to Insert simultaneously and IMAGE and VIDEO and DOCUMENTS in my database ???. Can you make tuto for this ?

jrk
visit shbcf.ru