Good Evening all
I have a script I am trying to bring alive.
I am calling an HTTPS endpoint that returns an array of features. Each feature has a unique ID.
After the initial fetch, I would like subsequent fetches to only insert new feature IDs if they are not already in the table. Each fetch from the endpoint returns everything added within 24hrs, not just new features. Therefore, I only want to insert new IDs.
Table Name : lightning
Unique Field Name : litID
Fetch Unique Field Name : litID
Here is what I have for the script at this moment:
let table = base.getTable('lightning')
let { records } = await table.selectRecordsAsync()
console.log (records)
let strikes = await fetch('https:********')
let { features } = await strikes.json()
console.log(features)
Thank you all for any help.
J