Hey guys, I'm wanting to import fields from 1 database into another, is there a way i can do this?
Import or link? Import is copying from one dataset to another, linking is like join two referencing fields to make a relation between them. which do you want?
If you're looking for something like joining two collections as Andreas has mentioned, we are working on that. Meanwhile, you can do a workaround with a bit of coding.
I created a master / detail showcase demo in showcase forum. That might get you somewhere but you should take the _ID fields I guess the WIX gurus say.
Sorry, I'll be more specific. I have some data in 1 database and want to be able to update a field in 1 database and have it change the other field.
Like for example in "database1" field A1 contains the value "text1"
In "database2" it's field A1 would contain something like "Database1\A1" to give it the value of "text1" so updating "database1" updates the content in "database2" without having to change it.
So, essentially linking not copying. What is the current work around and is there a timeframe for proper linking to be available?
Then I think you should look to hooks. The hooks before and after insert and there you could place code to update the second data collection with your newly inserted or updated data. There is hooks for before and after and INSERT, UPDATE and REMOVE that will be interesting for you.
Add the hooks to the collection where you edit and change data and then update the other using wix-data.
And just to add my 2 cents to Andreas proposal, you can add "Linked ID" field in database 1 to store IDs of linked items from database 2.
Could you also add some more details to picture a real-world problem you're trying to solve? That would help us understand the problem better when working on linking database feature.
Yeah sure. So I run an esports webpage and I have a list of Tournaments and Teams each with their own pages. The data is stored in separate databases.
The goal is that I will be able to update a tournament and list the teams competing and then each teams individual page will automatically add in the tournament they are competing in.
So in the Tournaments database will be a field for each team that links back to the teams database.
Cool, thanks for sharing!