Reference Fields

Hi, regarding reference fields in the database, the reason for these is because we can’t connect more than one dataset to a table/list/grid so we use reference fields from other databases to connect the data.

I have a table that pulls in data from a dataset for game data which includes player name, date pitched and number of pitches. All looks great. However, it is supposed to pull the division data for these players from the ref field in the team data collection however it is not showing the data.

I have checked permissions and all look ok. I checked the live database and the the division for these players is populated in the team data collection.

Can anyone help me fix this? I am obviously missing a step someplace!
Thanks!

1 Like

Is someone from WIX able to help me? I can’ figure out why the reference field data is not populating the data table. Isn’t it tied to the record when data is submitted on a form??

Hi Mark,
Reference fields does not populate data automatically into a collection.
You can use two reference fields to display referenced fields in the same table or using repeaters.
Check out this article:

You could use wixdata hooks and some code to achieve auto data population capabilities.
There is no code examples for this purpose (currently).

I hope this answered your question.

Thanks Omar. So I have the table set up to pull in data from one collection, but also I have a ref field in the table that is linked to a field in another collection. I have read all the docs on it and my understanding is that referenced data in table would show up in the table. So in my example, the division field in the table is a reference field pulling info from another collection. When I look in the main database where division is stored for each player, the info is there. So, should it not show up in the table if it is connected via a reference field? Thank you!

You can manually select the referenced data in your reference field of your collection. You can edit this straight on your wix site editor by clicking your collection. Note that you need to update the live collection for the data to show on your public site, or sandbox to test it using preview.
Then you can display any field from the collection or referenced items on a table in your page by linking it to the collection dataset.

You should also make sure you are using the right permissions for the collections in order to display the data on your site.

If you still can’t figure out something, you can add your site for reference.

Good luck!

Hi Omar, thank you for the reply. I have the ref fields all tied together and the permissions seem ok too. For some reason, I can’t get the reference field data to show up in the linked table…

So how it works is, the user inputs data to the teamdata database using form 1. The user then goes to form 2 to enter the game data. They can select the players name from the dropdown (reading data from form 1) and enters the division date and # pitches. This data is sent to the game dashboard, image 3 here.
The player name, date pitched age and number of pitches show up fine because they were picked from the game data collection. However, the division field is linked as a reference field to the teamdatabase. One would think it would read the division for this player which was assigned in form 1 to the teamdatabase and populate the division field in the game dashboard since it is referenced and linked together…

Could you add a link to your site so I can check it?

I am working on something similar, my understanding that will not autofill unless you code the hook into the submit.

Would love to see your code on this

how to add refrence field with help of code

pls help

Hi Welcome To Labs,
Please read this article , you might find this helpful

Dmitri, where does the Please read this article link go to?

Same thing For us, Need to make exact similar thing! but in our own reference fields id_ in the second DB, so tutorial shared by Omar can’t work for us and we don’t want to use a table. To make thing simple Omer if I want to save the ref field Id from the Scroll selection item, to the other db in a speficic field I have created. Can you share a tuto link to do it !

Hi all ! Everyone who know something doing similar please share the information… I’ve read it’s impossible to follow reference field or _Id from a dropdown submission from a Db to a other… That could be simple to achieve and a most have…

Here’s my suggestion How it should be done… Lot of User requested this function… I have read a lot about. In red/orange my suggestion of what lot of people expected for the selected Input Box with these added connection options…

The Input box if required could be hidden at page load, and this will allow user to submit to the other DB the ref field id or any other fiedl id coming from a db to a other. That could be really easy And open great possibilities.

Note that Dropdown1 is the button above and dropdown values are connected to primary DB ( of corse not here same of input : Gsoft_Import_Line-up…)

Need comments on this one all!

According this a question for WIX mod : It is About refrence field _id connection for a input box : Why it is impossible to set _id for a input box if the DATASET on the page is to READ ONLY ???