Accessing a module's items

Hello everyone,

I was faced with a very interesting problem today, and even after a search I was unable to come up with a solution to this case. I would like to create BigQuery tables dynamically starting from a Google sheets or from an Excel file. The idea would be to have a branch which creates a table if it doesn’t exist yet. However, in order to create the table, I need to extract the columns of the spreadsheet in order to generate the table’s schema.

I would like to dynamically extract those column names. In a GSheet, those columns become a module’s items when I use a “Get Range Values” API call. Is there a way to extract the list of those items names in an array ?

I first tried to extract the header names directly from my spreadsheet, however I didn’t find a way to do so:
Make

I then tried to tick the “Headers” option off and to extract the range 1:1 to get the column names, the module creates a collection with the columns “0” “1” “2”…

Make collection

The expected output would be an array containing [“date”, “tx_incid”, … , “incid_rad”], in order to map it in the bigquery “Create table” module.

Thanks for your help !

To get the headers use the keys() function on the google sheets array.