Reference fields

It’s pretty clear that reference fields are not fully supported at this time. The various questions here, including the one that I posted, demonstrate that there is missing functionality.

Suggestions that people use code to create workarounds for missing functionality are helpful to create workarounds but not satisfactory as a long-term solution.

Will someone please give us an idea of when additional support for reference fields will be available?

Thank you.

2 Likes

Hi Brian,

We are doing everything we can to make things easier on you all :slight_smile:
Having said that, features timelines are complex and taking everything into consideration, therefore we can’t commit on a date.

Liran.

Liran, thanks. I appreciate the response. I’ve been in the software biz for more than 40 years and well appreciate the challenges. That having been said, providing some guidance on future development can allow customers to plan their own development. Some kind of statement like “Wix Code” will be out of beta on February 1, 2018. The release 1.0 feature set will include…". Barring that, guidance in the form of “we recognize that these requested features are important and plan to include them in the Wix Code feature set in the first half of calendar year 2018” is also helpful.

Without such guidance, developers cannot count on needed functionality ever being present in the feature set. That kind of uncertainly tends to preclude the use of a tool for the development of serious and/or critical projects.

I am using Wix Code to add functionality to a small website that I created for free to help a young friend who has just started his first business. I had expected to build in some back-end information technology to support this growing business. However, in all honesty and in my professional judgment, Wix Code isn’t there yet. Consequently, we’ve shelved those plans. They are using other resources at this time. If Wix Code progresses to a point where it’s able to handle normal business database requirements, I would certainly consider moving forward again.

Don’t get me wrong. Wix Code is impressive in some aspects. If it wasn’t, we wouldn’t be using it at all. It’s easy to use for the things that it does support. The marketing behind it suggests that it’s capable of being used by non-technical website folks and perhaps it is; my personal judgment is that it is a bit too complicated for that audience for all but the simplest of tasks. That does not in any way take away from the value it brings to Wix.

Features that I suggest belong in Wix Code sooner rather than later:

  1. Displaying a record with a reference field. Right now, I can have a list of records displayed for a user. Clicking on one of those records can bring up a screen with much more detail on a particular records. This is very valuable and important. For example, a list of concerts could lead to a screen with an extended description of a particular concert. Once one knows how to do this in Wix Code, it’s very easy. However, it should be just as easy to display records with reference fields. For example, clicking on an event in a list of events would display a list of the activities that make up the event (with, obviously, each activity having a record in a data collection; one field in each record would be a reference field pointing to the event that the activity belonged to). Clicking on an activity would bring up a detailed description of the activity. This part is easy in Wix Code right now but the reference stuff isn’t.

  2. For the above to work, it’s critical to be able to add a record with one or more reference fields in it. From one of the previous responses, I understand that it’s possible to use back-end code to search the corresponding parent data collection and populate a drop-down table. I understand that and I understand how to do it. But I’m not doing it because the people who are starting this company wouldn’t understand what was going on and couldn’t maintain it. With all due respect (and I do respect what you folks have accomplished so far), this should be automatic. When creating a form with a data collection that contains reference fields, placing a drop-down on the form that corresponds to a reference field should cause the drop-down to be automatically populated with the corresponding values from the referenced table. Not only that, given the infrastructure you have already built, I have to believe that adding this particular bit of functionality would be relatively simple.

Having the ability to add a record with one or more reference fields populated on the screen would go a very long way toward greatly increasing the ability of Wix Code to meet common, everyday business database requirements. Similarly, having reference fields automatically populated on a form that could be used to update an existing record would be critical for maintaining data. This is exactly the same functionality as having it available for adding records but a slightly different flavor.

  1. Being able to add multiple filters with OR instead of just ANDing them all together. I ran into an instance where I wanted to list records that had field1 > 0 OR field2 > 0 or field3 > 0. I couldn’t do it. I could check if they were all > 0 but that wasn’t the business requirement. To solve this problem, we had to add a new field to the table and have someone maintain the sum of the fields manually. Being able to add filters with OR would have been helpful. In terms of adding this functionality, as soon as you add a switch in the manage data collection that specifies if filters should be ANDed together or ORed together, someone will come along and want parentheses: (filter1 AND filter2) OR filter3. Adding a simple toggle in the add filter section that says "all filters are ANDed together or all filters ORed together) would be relatively easy with the design you have added. Adding the ability to support complex conditions would require a paradigm change in the manage data collection definition and that would involve more work. But simply adding a toggle that supports the choice of AND or OR would add significant new capabilities to Wix Code.

Finally, a question: I’m quite curious why Wix Code uses the term “data collection”. Data collections are clearly tables. The word “table” is an industry-standard term. These days, anyone who has much experience with maintaining data understands the concepts of table, row and column. As a new term, “data collection” adds confusion to something that is otherwise likely easily understood by most of your audience before they even being using Wix Code. I was teaching database concepts to liberal arts majors as far back as 1976. In those days, programming and computers were foreign concepts to almost everyone. There was no such thing as a friendly, accessible computer. Nevertheless, these highly non-technical students would grasp basic database concepts like table, row and column in a matter of minutes because we humans use all kinds of tables all day long, from grocery lists to to-do lists. On the surface, it would seem that switching from “data collection” to “table” when release 1.0 is released would make your technology more accessible and more easily understandable to people in your target market. Perhaps you have a business reason for using “data collection” but many years in business have led me to believe that simplifying technology in the eyes of potential customers is a good thing.

All of the above should be considered suggestions and not requests. What my friend needed right now and what Wix Code was capable of supporting right now is up and running. Whether we develop more functionality into his website will depend on future developments of Wix Code. If Wix Code is moving in different directions, we will explore the use of other databases and/or other website generators.

Kind regards to all of you. I appreciate the responses you have all provided.

Hi Brian,
Thank you for the detailed feedback.

About #1
Do you mean you can’t achieve it with Wix Code or that it is hard to achieve what you wanted to build. Per your example if you have two collections one for Events, and the other for Activities and each activity has a reference to an event, you can, with no code create an event page that displays all activities.

  • Create a dynamic page for the event.

  • Add a second dataset and connect it to the Activities collection.

  • Connect a repeating element (Repeater, table or gallery) to the activities dataset. At this point, you see all activities and not only the ones related to the specific event.

  • Now go back to the activities dataset and add a filter to the event field to be the same value as the one in the main the dynamic page dataset of the event.
    About #2
    I agree that one needs to write some code for inserting an item with a reference field is a boundary for some users On a general note, we believe in releasing a feature, in this case the reference fields, to our users even if not all the non-coding paths already solved as it brings a lot of value even now. In any case, we will address it soon.

About #3
You could set the filter of a dataset using OR conditions via code see https://www.wix.com/code/reference/wix-dataset.html#setFilter

About Data Collections
Having a table view is, as you wrote, easy to understand and maintain for many users. However, our Data Collections are much more than regular tables. Using code you can insert JSON objects values for fields that are not part of the schema. In other words, we built the data collection to support more capabilities with code today and more complex structures for non-coders in the future.

Shay
Product Manager @ Wix Code

I think Wix code is a powerful modern development platform. I’ve been developing software fo 2 decades too. And I use Wix for 4 years now. Wix is adding more powerful features every year. I somewhat disagree with this 40-year coding veteran suggested about.

The reference field can be retrieved and edited with code. the “get” function is written clearly in the data API.

Some of the comments he made here are very old school and out of date. It is also clear that he hasn’t really given Wix code a fair chance and hasn’t worked with it a lot.

When he says: “Data collections are clearly tables. The word “table” is an industry-standard term.” That is not true. Graph QL is the latest data query tool. It doesn’t treat databases as table. It is treated as object-like collections. If you are still stuck with the old school SQL world, you won’t be able to build modern apps which has enormous complexity in the way that needs real-time update from the database to the client and sharing external resources.

Don’t know what environment he is used to in the past 40 years. Wix code gives you the entire ES6 to work with. It is using JQuery library which makes it very easy to access the elements on the page. Also, it is a React app (very fast and reliable). And you don’t need to write complicated SQL to work with your database. Instead, you just work with it like Graph QL (actually Wix way is a bit easier).

Using Wix code, you can fetch for 3rd part resource and services and design your own routing. That is the most important thing a modern development platform needs. It allows the platform to use other 3rd party resources and allows you to open your own service to other people.

But then I can see that Wix code could be too modern of a paradigm for old-school developers to grasp (could even be frightening for some) as they are very stuck in the old way of building closed systems.

I really don’t know what else to ask for (well, maybe adding more to the $w library, like accessing styles :slight_smile: ). I developed two major apps for a bank. Based on my experience, Wix has a lot of potential to be prime time. Serious developers should jump on the wagon, work with it and start building apps of the future.

I appreciate the hard work the Wix team puts in. And I am confident that they will bring more and more powerful features to the community.