Wix is a popular website building platform that offers a powerful set of tools for creating and managing websites. One of the most powerful features of Wix is its built-in database system, which allows you to create and manage datasets.
However, once you've created a dataset, you'll often want to know how many items are in it. In this blog post, we'll show you how to count Wix dataset results using JavaScript.
Step 1: Open Your Wix Website
To begin, open your Wix website in the editor. Once you're in the editor, click on the "Code" button on the left-hand side of the screen. This will open the Code Panel.
Step 2: Create a New File
In the Code Panel, click on the "New File" button to create a new file. Name the file "count-results.js" (or any name you prefer). This file will contain the JavaScript code that we'll use to count the results in our Wix dataset.
Step 3: Write Your Velo Code
Copy and paste the code below into the code section of your website
This code uses the Wix Velo API to retrieve the total number of items in a dataset, and then displays the result in a text element with the ID "countItems".
Make sure to replace "#dataset1" with the ID of your own dataset.
Code
Leave a comment (0)
Thanks for leaving a comment🎉