Hello! I don't understand why the linked field won't accept the value. What am I missing?
//Setup Start let tableName = "🎵 Tracks" let linkedField1Name = "Composer(s)" let linkedField2Name = "Producer(s)" let compiledLinkedFieldName = "Contributors (-mix)" //Setup End
let {linkedField1Values, linkedField2Values, recordId} = input.config()
let table = base.getTable(tableName)
let compiledObject = new Object;
for (let record of linkedField1Values){ compiledObject[record] = recordId console.log(record) }
for (let record of linkedField2Values){ compiledObject[record] = recordId }
let compiledArray = new Array;
for (let record in compiledObject){ compiledArray.push({id: record}) }
Maybe "Composer(s)" and "Producer(s)" are different tables?
Solved it now by removing the push update and having the script output the result instead, then updating the record via Update Record action in the same automation. But thank you for your time and effort Sho!
//Setup Start
let tableName = "🎵 Tracks"
let linkedField1Name = "Composer(s)"
let linkedField2Name = "Producer(s)"
let compiledLinkedFieldName = "Unique Combinations"
//Setup End
let {linkedField1Values, linkedField2Values, recordId} = input.config()
let table = base.getTable(tableName)
let compiledObject = new Object;
for (let record of linkedField1Values){
compiledObject[record] = recordId
}
for (let record of linkedField2Values){
compiledObject[record] = recordId
}
let compiledArray = new Array;
for (let record in compiledObject){
compiledArray.push({id: record})
}
console.log(compiledArray)
output.set("compiledArray", compiledArray);
Maybe "Composer(s)" and "Producer(s)" are different tables?
Solved it now by removing the push update and having the script output the result instead, then updating the record via Update Record action in the same automation. But thank you for your time and effort Sho!
//Setup Start
let tableName = "🎵 Tracks"
let linkedField1Name = "Composer(s)"
let linkedField2Name = "Producer(s)"
let compiledLinkedFieldName = "Unique Combinations"
//Setup End
let {linkedField1Values, linkedField2Values, recordId} = input.config()
let table = base.getTable(tableName)
let compiledObject = new Object;
for (let record of linkedField1Values){
compiledObject[record] = recordId
}
for (let record of linkedField2Values){
compiledObject[record] = recordId
}
let compiledArray = new Array;
for (let record in compiledObject){
compiledArray.push({id: record})
}
console.log(compiledArray)
output.set("compiledArray", compiledArray);
Solved it now by removing the push update and having the script output the result instead, then updating the record via Update Record action in the same automation. But thank you for your time and effort Sho!
//Setup Start
let tableName = "🎵 Tracks"
let linkedField1Name = "Composer(s)"
let linkedField2Name = "Producer(s)"
let compiledLinkedFieldName = "Unique Combinations"
//Setup End
let {linkedField1Values, linkedField2Values, recordId} = input.config()
let table = base.getTable(tableName)
let compiledObject = new Object;
for (let record of linkedField1Values){
compiledObject[record] = recordId
}
for (let record of linkedField2Values){
compiledObject[record] = recordId
}
let compiledArray = new Array;
for (let record in compiledObject){
compiledArray.push({id: record})
}
console.log(compiledArray)
output.set("compiledArray", compiledArray);
Rad, this helped me solve a similar issue I was facing regarding linked records in the automation environment.