Skip to main content
Solved

Write to the currency field in Airtable using Javascript


Hi

I'm reading my Airtable data using the API which is working fine, I'm now trying to write back to Airtable but I am having issues.

I can write to Airtable successfully if the field is a string or a number but I can't when it's a currency. Any ideas how I do this?

This is how I am currently doing it:

 

Request.headers['Authorization'] = 'Bearer API here'

const obj = Noodl.Object.get(Inputs.ObjectId)
  Request.content = {
    records: [
      {
        fields: {
          "Overhead": obj["Overhead"],
          "Amount": obj["Amount"]
        }
      }
  ]
}
 
Amount is currently a number although it doesn't matter if it's a string or a number as they both work but currency does not.

Best answer by TheTimeSavingCo

Hmm I can confirm that I'm able to update a "Currency" type field via the API with a number (e.g `5`), and if I try to do so with a string, it fails (e.g. `"5"`).  Sorry I can't help more, but figured I'd provide the data point

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

2 replies

TheTimeSavingCo
Forum|alt.badge.img+18

Hmm I can confirm that I'm able to update a "Currency" type field via the API with a number (e.g `5`), and if I try to do so with a string, it fails (e.g. `"5"`).  Sorry I can't help more, but figured I'd provide the data point


  • Author
  • Known Participant
  • 16 replies
  • February 3, 2023
TheTimeSavingCo wrote:

Hmm I can confirm that I'm able to update a "Currency" type field via the API with a number (e.g `5`), and if I try to do so with a string, it fails (e.g. `"5"`).  Sorry I can't help more, but figured I'd provide the data point


That helps, thank you.


Reply