Linking tables after importing from database
I have imported several tables via CSV and would like to link them afterwards. I have a unique ID (company name) which I could use as a link. How can I link tables that were already linked in another software?
15 replies
-
can you give us a bit more information?
what are the table names?
what are the reference field names in the tables?
-
Apparently andreasreitz either found an answer or gave up. But I still have the question. I have a main Addresses table and another table, Christmas cards, with a field "Link" which should be used to relate it to the "ID" field in Addresses. Each Addresses record may not have a link in Christmas cards, or it may have many links (one for each year). How do I make this work?
-
Is there a way of automatically creating the records in either Christmas cards or the N:N table? It would be very time-consuming to do them one by one.
-
said:
The names and addresses are not unique. Could I rename the Addresses.id field to "link" or something else and make that work?No need to change field names, plus you can't change the field Id as that is a Ninox field.
In the Addresses table, go to record 41 and create a new button and put this in the On click:
do as server let t := this; for loop1 in select 'Christmas cards 2023 1230' where Link = t do loop1.(Addresses := t) end end
Line 1 tells Ninox to run the code on the server. If you use the public/private cloud then it will run on Ninox's server, which is generally faster the larger your tables get.
Line 2 gets the current record info using recId format. This allows us to link to the record and access any fields in the record if needed.
Lines 3 - 5 is a for loop that finds all records in Christmas Cards where the data in Link equals the current record Id.
Then it goes through each record that is found and sets the Addresses reference field to be equal to the current record we are on.
Line 6 ends the do as server.
Content aside
- 11 mths agoLast active
- 15Replies
- 166Views
-
4
Following