Dynamically populate a graph with rows from AirTable

Hey folks, I’m trying to display a simple chart of currency prices based on the date. my data is stored in AirTables and is dynamically updated daily by a Zpier integration to create new rows in airTables with the daily price data.

I’m trying to display this data on a line graph.

Steps I have taken:

  1. Create the HTTP request
  2. Run data mapping code in javascript to define variables

  1. Save AppState appData_currencyPrices

But then I’m trying to display this data in the CONTENT DATA section of the page builder. How do I use a variable here to keep pulling in a dynamic array?

Here is my attempt using the variables priceDate and hexPrice that I defined in my javascript.

name: ‘HEX Prices’,
color: ‘#8B85FF’,
data: [
[‘priceDate’, ‘hexPrice’],
[‘February’, 30],
[‘March’, -43],
[‘April’, 19],
[‘May’, -24],
[‘June’, -59],
[‘July’, 10]

But obviously this isn’t going to keep getting new records. How do I do that? Thanks!

hi @TimTim!
As a quick idea, you need to use setInterval which would execute your function each period of time. So that the data would be loaded, for example, each 2 seconds.