Help

Re: How to use updateRecordAsync

41 0
cancel
Showing results for 
Search instead for 
Did you mean: 

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
})

 

tylermwise_1-1733073279581.png

 

tylermwise_0-1733073270742.png

 

2 Replies 2

Update! I fixed this error and now I have this error... 

Error: Request parameters failed validation.

 

TheTimeSavingCo
18 - Pluto
18 - Pluto

Try using 'Airtable record ID' in your config and correcting the typo with 'inputConfig'

Screenshot 2024-12-02 at 2.57.19 PM.png

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!