With the link you can absolutely fill it in from the Magazines form, that makes complete sense because when you add from the Magazines form, it autolinks the Magazine to the article for you similar to how the Table field operates.
The Articles form is just a more accessible version of the table field you created, I think under the hood Brendan modelled them the same way, it’s just that you don’t see the form as the field itself is the form. You could hide the Articles form if you wanted so you’d not see it in the forms list but would still be able to interact with it. I personally like having them all available but the option is there.
We can automate a lot of things using the calculation fields to pull data from the parent record. Tap Forms can’t give you a table view that has fields from either two different forms or fields from the parent form and rows in a table field. That’s in part where that Articles form comes in because we can reference that from other forms (Keywords in this case) and since it is linked to the Magazine form, we can use calculation fields in the Articles form to automatically replicate values from the parent Magazine form. The other advantage is that Tap Forms’ Link to Form JOIN field works on the form making it a little easier.
If you only want to link to the magazine plus magazine month and don’t need the article name or page details (essentially anything in your articles table or the articles form) in your keyword form, then you could change the Articles form (and link) back into just a simple table. I might have misunderstood along the way but I thought it was useful to see the article and page details for the keyword as well. That’s what a lot of this is predicated on is pulling all of those fields together into the keyword to make a table.
Looking at your second screenshot, if the Magazines link isn’t useful then you can safely remove it and for the articles link in your second screenshot if you click on the X button on the far right you can hide fields and reorder them (this also works in the multicolumn list view as well). Getting magazine month and number should be a calculation field that populates the value from the parent magazine form, this is just a matter of setting the fields up and making sure they have the right type (date for the month field and number for the number field [number should be the default]). If the calculation field is misbehaving, jump to the Articles form and click on the refresh icon on the bottom of the list view and it should recalculate the fields to update to the right value.
The challenge with automatically creating a keyword if one doesn’t exist is that we need to scan the keywords form to find what keywords exist and do an insert if one doesn’t exist. If I was using something like MySQL, it has functionality that is optimised to make this mostly cheap through it’s indexing system but Tap Forms isn’t built with a columnar index structure but is a document store. That means we need to build the index ourselves. Doing this each time you edit the keywords field is probably a little intensive and would slow Tap Forms down as your database scaled in keywords. I’m also going to make an assumption that you’re going to hit a threshold where adding a new keyword is a rare event rather than a common one, as it will be today. Given both of those, I went to create a form script that handles it. You could also modify it to be a script field (might even work as is) but again that would be a little disruptive to editing that might not be appreciated.
Here is a quick little form script that runs on the currently selected magazine record, scans the linked articles and checks the keyword table to see if it exists and creates a new keyword record if it doesn’t exist. It’s actually a slightly modified version of the earlier script, just without the link creation steps:
function Update_Keywords() {
// This is the other form that has our keywords in it.
let keywordForm = document.getFormNamed('Keywords');
// This is the field ID in the "keywords" form for the link to field to Magazines.
let magazines_id = 'fld-b4724a28d4094b3faa9910f18374588f';
// This is the field ID in the "keywords" form for the keyword field.
let keywords_keyword_id = 'fld-ebaf7ffa3d484834bdcc34d3ffb9c5f2';
// This is the field ID in the "magazine" form for the keyword field in the articles table.
let keyword_id = 'fld-a75febca3ee54d2d9d77b8c176ac08db';
// Articles link field ID
let articles_link_id = 'fld-9af3b672710949d8a96591e23ba5466b';
// This is to store a map of keyword to keyword record.
let kwRecords = {};
// Build the map of keyword to keyword record (cache if you will).
console.log("Finding keyword records...");
for (let keywordRecord of keywordForm.getRecords())
{
console.log("Adding keyword: " + keywordRecord.getFieldValue(keywords_keyword_id));
kwRecords[keywordRecord.getFieldValue(keywords_keyword_id)] = keywordRecord;
}
console.log("Completed finding keyword records.");
// Iterate over every record in this form...
for (let sourceRecord of record.getFieldValue(articles_link_id))
{
// Get the value of the keyword field...
let keyword = sourceRecord.getFieldValue(keyword_id);
// Skip it if it is empty...
if (!keyword)
{
continue;
}
// Check if a keyword record exists for it...
if (!kwRecords[keyword])
{
// Create keyword record if it doesn't exist...
console.log('Creating keyword record');
kwRecords[keyword] = keywordForm.addNewRecord();
kwRecords[keyword].setFieldValue(keywords_keyword_id, keyword);
}
// Log the keyword we processed, we're done!
console.log(keyword);
}
// Save the changes.
form.saveAllChanges();
}
Update_Keywords();