You've got data, and you want to put it on TRMNL.
If the content fits nicely on a website, Screenshot might do the trick. If it's live at a JSON endpoint, Private Plugins with a Polling URL work great.
But what if you don't code, or don't want to code, and it's easier to put the content inside a Google Sheet?
Step 1 - Test Drive
If you know what you're doing, skip to Step 2.
Otherwise, download our demo plugin zip file and import it to your account via Plugins > Private Plugin > View All > Import new.
Note, you need at least 1x Private Plugin to exist before this screen will appear.
After importing, click Edit Markup in the top right corner to open the live preview.
Scroll down inside the code editor to see how it works. The raw data is visible here.
You may also adjust "ColumnChart" to "LineChart" or "BarChart" on Line ~68.
Step 2 - Point to real data
From your Google Sheet, click Share and add the "Anyone with a link can view" permission.
Next, adjust the spreadsheet URL like so:
https://docs.google.com/spreadsheets/d/spreadsheet-id-goes-here/export?format=csv
Inside TRMNL > Plugins, create a new Private Plugin. Input your modified spreadsheet URL into the "Polling URL" field and leave all other settings alone.
Click to Save in the top right, then click "Force Refresh" to expedite TRMNL's data fetch.
Navigate to the Markup Editor, and find your spreadsheet data inside Your Variables > Data.
Raw data from your Google Sheet lives inside a node called data
, as an array of arrays. Each array element represents a row of data in your spreadsheet.
If you wish to ignore the header row, for example to build a chart, the following Liquid syntax will repurpose your {{ data }}
collection to only contain rows with actual information.
// remove header (1st) row from spreadsheet data with slice
{% assign formatted_data = data | slice: 1, data.size - 1 %}
Now you may iterate through formatted_data
inside any charting library (JavaScript), or within the HTML itself.
Import the demo plugin for a live example.