Skip to main content
Solved

Write to the currency field in Airtable using Javascript

  • February 3, 2023
  • 2 replies
  • 41 views

Forum|alt.badge.img+7

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

2 replies

TheTimeSavingCo
Forum|alt.badge.img+31
  • Brainy
  • 6459 replies
  • Answer
  • February 3, 2023

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


Forum|alt.badge.img+7
  • Author
  • Known Participant
  • 16 replies
  • February 3, 2023

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.