Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Get specific Value from API response

Topic Labels: ImportingExporting
Solved
Jump to Solution
1892 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Gordon_Szulc
5 - Automation Enthusiast
5 - Automation Enthusiast

HI all,

I’m hoping for a little direction here. I have managed to write a script to retrieve a single record from Base B based on a Date/Time field in Base A.

My problem is that I can’t figure out how to then extract a value from that response.

The response looks like this (I have REMOVED record Specifics). I am trying to extract ‘Height’ 3.49 in this case, which is a number in Base B. I then plan to update the initial record in Base A using that figure (I think I can do that bit once I can get the number out of the response).

Sorry if this seems very basic, but learning as I go.

{records: Array(1)}

  1. :arrow_forward: records: Array(1)

  2. :arrow_forward: 0: Object

1. id: "REMOVED"

2. ▶fields: Object

  1. Timestamp: "2020-07-28T12:10:00.000Z"

  2. Date: "28/07/2020"

  3. Time: "12:10"

  4. Height: 3.49
3. createdTime: "2020-07-28T09:18:24.000Z"

Script so far looks like this

let table = base.getTable(“Table A”)

let record = await input.recordAsync(’’,table )

var search = record.getCellValue(‘Movement’)

output.text(search)

let url = “https://api.airtable.com/v0/REMOVED/Table%20B?filterByFormula=SEARCH(’”+search+"’,+ Timestamp)"
var response = await fetch(url, {
method: “GET” ,
headers:{
‘Authorization’: “Bearer REMOVED”
}
})

Thanks in advance.

1 Solution

Accepted Solutions
Gordon_Szulc
5 - Automation Enthusiast
5 - Automation Enthusiast

No need for reply all sorted !

Thanks

See Solution in Thread

1 Reply 1
Gordon_Szulc
5 - Automation Enthusiast
5 - Automation Enthusiast

No need for reply all sorted !

Thanks