I already have a scenario that pulls weather data each hour and records it to Google Sheets. This part of the equation is working.
What I’d like to do next is take the last 24 rows - aka the past 24 hours of data - and convert that to an image. I would use two columns, “Hour” and “Temperature” to create the data.
What seems to be happening is that the scenario is getting the last 24 rows and feeding it to QuickChart 24 times. Which then creates 24 images, instead of just 1 image with the data on there.
Is there a step I’m missing? I know I need to pull the temperature from the Sheet, and then have that as the dataset for the chart, but I can’t seem to get all of them into a single image.
What you want to do is, Put an Array aggregator in between Google Sheets and QuickChart. In the array aggregator, select target structure type to QuickChart Datasets, and over there add the temperature data that you are getting from GSheet.
Afterwhich, In the QuickChart Create a Chart, Click the Map option at the rightside of the Datasets, and after selecting the map, put the array aggregator output to it.
I’m this close. The issue that I have now is that the “21” number seems to be changing based on the number of rows I pull from the Google Sheet. So “Maximum number of returned rows” in Google Sheet I’ve tried 3, 7, 24, etc. And each time the value of what you showed as “21” keeps changing.
No 21 will be fixed, because it is the column index, so for eg,. if you column is B then it’s value is 1, if it is E it will be 4. It should be reflected on the Array aggregator.
Alternative, what you can do for this is instead of using array aggregator, use text aggregator instead and put temperature over there and then on advanced settings use seperator as comma.
Somehow, most likely to confusion, I swear the column index was changing relative to the number of rows I pulled from Google Sheets. However, since I figured out that it’s column index 3 (column D) that the temperature is on, it seems to be working now.
What do I need to go read about to learn more on the {{join(map(12.array; 3); “; ”)}} that went into the Datasets field?
Not sure what is the content in this, Make Academy
I generally suggest it. You can go through this to get more info on join and map function that we used for this.
What we are basically doing though is, array aggregator, it will aggregate everything from the source module specified in this case Search Rows Module, and over there we are picking the temperature.
And, In the function map, what it does is since the array aggregator result is an array of collection, we are basically converting it to primitive array i.e value only. So,
map(array;3)
What this does is grab all the temperature value based on the key, in our case 3 is the key, so it will return,
[1, 23, 12, 12] and something like this, which after using the join function will yield,