Dec 01, 2024 09:15 AM
Hey!
I am trying to update a record based on the user's id, currently, I have this code but for some reason it errors saying:
TypeError: Invalid arguments passed to table.updateRecordAsync(recordOrRecordId, fields):
• recordOrRecordId →
recordOrRecordId should be a Record, not a number (5)
or recordOrRecordId should be a string, not a number (5)
Basically I am trying to update the field URL for the user based off their user id, the text I want in the field URL is from the "strHash" string
let table = base.getTable("Participant");
let record_id = inputConfig.record_id;
await table.updateRecordAsync(record_id, {
"URL": strHash
})
Dec 01, 2024 09:47 AM
Update! I fixed this error and now I have this error...
Error: Request parameters failed validation.
Dec 01, 2024 10:54 PM - edited Dec 01, 2024 10:58 PM
Try using 'Airtable record ID' in your config and correcting the typo with 'inputConfig'
let table = base.getTable("Participant");
let record_id = input.config().record_id;
let strHash = 'test'
await table.updateRecordAsync(record_id, {
"URL": strHash
})
Not sure if the snippet you pasted is all your code, apologies if it wasn't!