Getting JSON and populating an AirTable field

I am creating a proof of concept script which you can see below:

const data = { title: 'AirTable Pusher', content: 'Push, push, push this.', excerpt: 'The short version' };

let response = await remoteFetchAsync('', {
    method: 'POST',
    body: JSON.stringify(data),
    headers: {
        'Content-Type': 'application/json',
        'Authorization' : 'Basic d2h5d29udHlvdWNvbm5lY3Q6Y2N1WSAxWWhkIDdsTmkgMzdWSSB5MVlyIDYySEs='

The return on the server side if you check at the time of this writing is:

It returns some JSON data - I want to access that in the AirTable script - however when I check the Console log response it says the following:

{type: "basic", url: "", status: 200, statusText: "OK", ok: true…}
type: "basic"
url: ""
status: 200
statusText: "OK"
ok: true
headers: Object
redirected: false

Without any reference to the JSON that is returned.

How do I access the JSON variables returned?

Hi @Kosta_Kondratenko
I think you need to turn the response into JSON. Try:

let json = response.JSON()
1 Like

Thank you! It worked!

I think I was trying with response.json without the brackets ().

Really appreciate it and will mark your answer as solution :pray:

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.