Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › How to import “linked” forms
Tagged: link to form
August 2, 2021 at 2:31 PM #44894August 4, 2021 at 9:33 AM #44908
What is your reservation about using the Join Link Type?
Were you importing your CSV files into the same document from whence they came? If so, then the unique record IDs would simply be matched with existing records and those records updated. You wouldn’t get new records for them.August 4, 2021 at 9:38 AM #44910
With regards to the import problem, I was importing into a new empty document.
The problem I have with the Join Link type is that I created a new database for purchases and items after date X, and in that database I have used the 1 to many link type and set the links explicitly. I would like to import my old data from the spreadsheet (from before date X) into the new database. I cannot have both JOIN and 1-to-Many for the same field. I suppose I could have two fields, “Purchase” and “Legacy Purchase.” I could live with that. Is there a way, perhaps using a script, to copy the references from a “JOIN link” field to a 1-to-Many field?August 4, 2021 at 4:15 PM #44915
You can use a script to get the children of one Link to Form field of JOIN type and then add them to another Link to Form field. In terms of script, a form script like this should do the trick:
record.getFieldValue('fld-joinfieldid').forEach(rec => record.addRecordToField(rec, 'fld-1tomanyfieldid'));
You could expand it to run on all of the records in your form but this will do just the currently selected record. I haven’t tested it but it should work.August 4, 2021 at 5:01 PM #44916
Thanks! That should be enough to get me on my way!
You must be logged in to reply to this topic.