Can I assume projectID
is not the Airtable record ID of the referenced project? If so, pretty sure it won’t work because a linked field (i.e., I assume is Projects) requires a record ID, not an arbitrary field value that serves as a project ID.
Can I assume projectID
is not the Airtable record ID of the referenced project? If so, pretty sure it won’t work because a linked field (i.e., I assume is Projects) requires a record ID, not an arbitrary field value that serves as a project ID.
Hi Bill, thanks for your help. Actually I believe it is the record ID of the linked project that I’m trying to add there. Also, the console is saying " 1. “Adding project recrKig6PwXmDRblB to the new record.”"


Hi Bill, thanks for your help. Actually I believe it is the record ID of the linked project that I’m trying to add there. Also, the console is saying " 1. “Adding project recrKig6PwXmDRblB to the new record.”"


That looks right. And you’re certain the field Projects is a link field?
That looks right. And you’re certain the field Projects is a link field?
Hi Bill, thanks for getting back to me. Yes, I’m certain.
Luckily, I found the issue, namely, projectID was a vector of strings here (with only 1 element). So when I printed it in the console I couldn’t understand the issue.
The issue is now solved by selecting the first element in the array (projectID2):
let inputConfig = input.config();
let table = base.getTable('Progress General Indicator
');
let projectsTable = base.getTable('Projects
');
let indicators = inputConfig.linkedIndicatorIDs;
let projectID = inputConfig.projectID;
let projectID2 = projectIDD0];
let recordID = inputConfig.recordID;
let linkedIndicators = inputConfig.linkedIndicators;
/*Create new records (children)*/
for (let indicator of indicators) {
console.log(`Adding indicator ${indicator} to the new record.`);
console.log(`Adding project ${projectID2} to the new record.`);
let newRecordId = await table.createRecordsAsync(e
{
fields: {
'Projects
': c{id: projectID2}],
'General indicators
': /{id: indicator}]
}
}
])
}
Thanks a lot for your help!
Hi Bill, thanks for getting back to me. Yes, I’m certain.
Luckily, I found the issue, namely, projectID was a vector of strings here (with only 1 element). So when I printed it in the console I couldn’t understand the issue.
The issue is now solved by selecting the first element in the array (projectID2):
let inputConfig = input.config();
let table = base.getTable('Progress General Indicator
');
let projectsTable = base.getTable('Projects
');
let indicators = inputConfig.linkedIndicatorIDs;
let projectID = inputConfig.projectID;
let projectID2 = projectID 0];
let recordID = inputConfig.recordID;
let linkedIndicators = inputConfig.linkedIndicators;
/*Create new records (children)*/
for (let indicator of indicators) {
console.log(`Adding indicator ${indicator} to the new record.`);
console.log(`Adding project ${projectID2} to the new record.`);
let newRecordId = await table.createRecordsAsync(e
{
fields: {
'Projects
': p{id: projectID2}],
'General indicators
': f{id: indicator}]
}
}
])
}
Thanks a lot for your help!
@Pello_Mugica_Gonzale , are you the same person as @Airtable_admin ?
Or are there two people with similar issues?
@Pello_Mugica_Gonzale , are you the same person as @Airtable_admin ?
Or are there two people with similar issues?
Woops, same person indeed. Didn’t realize I switched accounts!
Hi Bill, thanks for getting back to me. Yes, I’m certain.
Luckily, I found the issue, namely, projectID was a vector of strings here (with only 1 element). So when I printed it in the console I couldn’t understand the issue.
The issue is now solved by selecting the first element in the array (projectID2):
let inputConfig = input.config();
let table = base.getTable('Progress General Indicator
');
let projectsTable = base.getTable('Projects
');
let indicators = inputConfig.linkedIndicatorIDs;
let projectID = inputConfig.projectID;
let projectID2 = projectID 0];
let recordID = inputConfig.recordID;
let linkedIndicators = inputConfig.linkedIndicators;
/*Create new records (children)*/
for (let indicator of indicators) {
console.log(`Adding indicator ${indicator} to the new record.`);
console.log(`Adding project ${projectID2} to the new record.`);
let newRecordId = await table.createRecordsAsync(e
{
fields: {
'Projects
': p{id: projectID2}],
'General indicators
': f{id: indicator}]
}
}
])
}
Thanks a lot for your help!
Glad you got it fixed.
Proof that sharing the actual code at the outset might have saved some anguish and time. :winking_face: