Jan 14, 2021 03:37 PM
I am trying to push multiple values in a look-up table at once to a single update field.
So far I am filtering the record, finding the IDs of the values in one of the values. Pulling out specific ones and then I am not sure what to do to update multiple values inside of a new field with a look-up table.
Note, I didn’t copy and paste properly. The syntax is not the problem, the problem is that I do not know how to get the multiple look-up values to update.
//// CODE BELOW
testID = “recZnhmuRKPJEvVE0”
let t_results = base.getTable(“results”)//
let thisrecord_as = await t_results.selectRecordsAsync();
let thisrecord = thisrecord_as.records.filter(f_record =>
f_record.getCellValueAsString(“cli_res_id”) ==testID );
for (i=0; i<thisrecord.length; i++) {
let this_spec = thisrecord[i].getCellValue(“Input_Look_Up_Field”)
let this_fm_id = thisspec.id
var pushval = { fields: {
"UpdateField": [{id: this_fm_id}]
}
}
}
if (pushUpdates == 1) {
await t_Client_results.updateRecordAsync(testID, addtopfoods )
console.log(`l-241 -WOot It's OOOUT `)
}
Solved! Go to Solution.
Jan 15, 2021 04:01 AM
Nevermind. I solved it. I am just pushing the wrong values in the loop in the above code.
I created a var that I pushed the following to and then used
var pushthisvar =
pushthisvar.push( {id: this_foodmap_id})
updateRecordsAsync(record ID, {
“Field Name”: pushthisvar })
Jan 15, 2021 04:01 AM
Nevermind. I solved it. I am just pushing the wrong values in the loop in the above code.
I created a var that I pushed the following to and then used
var pushthisvar =
pushthisvar.push( {id: this_foodmap_id})
updateRecordsAsync(record ID, {
“Field Name”: pushthisvar })