Wix App Collections, Permissions, and Code: Velo Feature Guide for Developers

Written by velo | Published 2021/04/16
Tech Story Tags: velo | web-development | wix | coding-with-velo | backend | beginners | javascript | software-development

TLDR Wix app collections are special collections that come from some Wix apps you may have added to your site. These collections appear automatically in your Content Manager when you have Wix Data enabled. Wix App Collections contain information about the items in your app. You can use the information in these collections just like you would use information in a collection you created yourself. With the data in Wix collections you can do the following:Display content from App collections in your page elements. Create a customized page with elements that link to your app's built-in dynamic pages.via the TL;DR App

This article explains what Wix app collections are and how you can work with them.

What Are Wix App Collections?

Wix app collections are special collections that come from some Wix apps you may have added to your site. These collections appear automatically in your Content Manager when you have Wix Data enabled on your site.
Each app will have different collections. For example, if you have the Wix Billing app on your site, you will see Billing collections such as Invoices and PriceQuotes  grouped together in a section called "Billing." If your site has the Wix Bookings app, you will see Bookings collections such as Schedule, Services and Staff listed in a section called "Bookings." 
Click a collection to open it.

What Are Wix App Starter Collections?

Some Wix app collections are called Starter collections. When the Wix app is added, you get a form template and an empty collection that you can use and modify. 
Unlike regular Wix app collections:
  • Form fields are connected dynamically to fields in the starter collection.
  • You can customize starter collections by adding fields, renaming, and more. 
For example, the Wix Forms app gives you a starter collection depending on the form you choose. If you choose a Contest form, an Enter Contest collection is created for you with fields related to contests such as First Name, Last Name, Email, Phone, Birthday, and more. The fields on the form are dynamically connected to the fields in the collection for you, so each time. 
Also, you can manually add additional fields to the form, such as an anniversary or a signature, and manually connect them to new fields you add to the collection... as you would any other collection.

How Do Wix App Collections Work?

Wix app collections contain information about the items in your Wix app. For example, if you have Wix Stores on your site, your Products collection will contain information about the products you sell in your store. The fields (columns) in the collection provide information about each item (row), such as the item's name, stock number, price, and image.
Every time you add a new app item or make changes to an existing app item in your dashboard, the changes are automatically reflected in your app collection. 
  • Regular Wix app collections are read-only (that's why the table cells are all gray), so any changes you want to make must be done in the relevant app manager.
  • Wix app starter collections are read-write and are totally customizable, like any collection you create manually.
For more information about the specific fields in each Wix app collection, see the App's section in the table of contents here.

What Can I Do with the Wix App Collections?

You can use the information in these collections just like you would use information in a collection you created yourself. With the data in Wix apps collections you can do the following:
  • Display content from App collections in your page elements.
  • Link to your apps pages: You can create a customized page with elements that link to your app's built-in dynamic pages such as Stores/Product pages or Bookings/Service pages.
  • Create your own customized dynamic pages based on your app collections.
  • Create a collection with additional information about the items in your app, and use reference fields or dataset filtering to display the additional information on your site. 
You can also write code that references these collections to add customized features to your apps. Learn how here. See the app examples in the Velo Examples site, as well as the app code articles for each app.

Wix App Collection Fields

You can view information about the specific fields (columns) of an app in the "Collection Fields" article in the app's section here. Each article lists the fields in the collection, including the field name, field keyfield type, a brief description, whether the field can connect to data, and whether it can be sorted or filtered.
Note
Wix app starter collection fields are read-write and can be changed like any collection you create manually. Regular Wix app collection fields are read-only and can only be changed from the relevant app manager in your Dashboard.

Wix App Collection Permissions

Wix app collections have limited permissions that cannot be changed. Each collection permission (read, create, update, delete) is assigned a role.
You can see the collection's permission settings by clicking Permissions in the Content Manager.
Permissions affect what your visitors can do with the collection content. 
Examples
For the Stores/Products collection, anyone can read collection content, and no one can create, update, or delete collection content. This means the following:
  • You can display all Products collection content that can connect to data in page elements, and all visitors will see the content.
  • You cannot connect user input elements to your Products collection and have visitors update the collection.
For the Members/PrivateMembersData collection, only site member authors can read collection content, and no one can create, update, or delete collection content. This means the following:
  • You can display PrivateMembersData content that can connect to data in page elements, but each member will only see the content from their own member item.
  • You cannot connect user input elements to your PrivateMembersData collection and have visitors update the collection.
When using code to perform data operations, you can override collection permission restrictions by using WixDataOptions.

Written by velo | Velo is a full-stack development platform that empowers you to rapidly build, manage and deploy professional web apps.
Published by HackerNoon on 2021/04/16