Simple Example of Wix Data Hooks

Adam Presley
3 min readJun 17, 2023
Photo by Mihail Tregubov on Unsplash

Let’s discuss a handy feature of Wix Data Collections: Data Hooks. Data hooks allow you to run code before or after interactions with your Wix data collections. This is particularly useful if you want to store some computed data, meaning data that changes based on what is in the data collection record. In the example, let’s use a data hook to fill in a column named fullName comprised of firstName and lastName.

Let’s say we have a collection that is used to populate a page that looks like this.

A webpage with names and pictures

The collection that populates this data is a collection named people that look like this.

First version of the “people” data collection

Notice that the named displayed under each picture is on the first name. We want the full name! Let’s address this by first adding a new column named fullName.

Adding the fullName field

--

--

Adam Presley
Adam Presley

Written by Adam Presley

Just a guy who loves his wife, kids, and writing software.

No responses yet