Help

Write to the currency field in Airtable using Javascript

Solved
Jump to Solution
1634 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Evos_World
6 - Interface Innovator
6 - Interface Innovator

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.
1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

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

See Solution in Thread

2 Replies 2
TheTimeSavingCo
18 - Pluto
18 - Pluto

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.