Creating an image from Google Sheets Data

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.

The first idea was something like this.

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.

1 Like

Assuming that you figured out the last 24 part.

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.

1 Like

So far, no I have not. Will work on the rest of your suggestion though.

I can’t select QuickChart is the Array Aggregator.
Obviously, I have much more to learn.
Any recommended reading I should be doing? :slight_smile:

Can you try clicking the Map option in DataSets first and see if that refresh the target data structure, Maybe I am missing something on this.

1 Like

I toggled the Map setting, with and without information in the Dataset field. Neither one activated the Target Structure Type.


My bad, thought it was a collection.

Just select the temperature in the Array Aggregator.

And, Enable the mapping in the QuickChart,

over there just use this formula,

{{join(map(1.array; 21); “,”)}}

Wherebym the 21 over here is the column number for temperature, you should be able to see the data from the array aggregator to use that.

And, the formula will go to the dimension section,

Screenshot from 2023-05-23 02-53-50

Basically, this formula will generate a comma-separated string that can be used for the DataSets.

1 Like

Thank you for your assistance.

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.

Standby … I think it just worked. Investigating.

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.

1 Like

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?

1 Like

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,

1,23,12,12 that we can use on DataSets field.

1 Like

Thank you for the help.
It is appreciated.

1 Like