Skip to main content
Solved

How to use updateRecordAsync

  • December 1, 2024
  • 3 replies
  • 12 views

tylermwise
Forum|alt.badge.img+4

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

 

 

 

Best answer by TheTimeSavingCo

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!

View original
Did this topic help you find an answer to your question?

3 replies

tylermwise
Forum|alt.badge.img+4
  • Author
  • New Participant
  • 4 replies
  • December 1, 2024

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

Error: Request parameters failed validation.

 


TheTimeSavingCo
Forum|alt.badge.img+28

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!


tylermwise
Forum|alt.badge.img+4
  • Author
  • New Participant
  • 4 replies
  • December 2, 2024
TheTimeSavingCo wrote:

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!


THANK YOU!


Reply