Simple Example of Wix Data Hooks
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.
The collection that populates this data is a collection named people that look like this.
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.