Aug 18, 2020 04:25 AM
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)}
:arrow_forward: records: Array(1)
: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.
Solved! Go to Solution.
Aug 29, 2020 01:30 AM
Aug 29, 2020 01:30 AM
No need for reply all sorted !
Thanks