Im trying to query for a specific row in google sheets, and currently im using Query JSON with SQL as a resource. Here is what the data looks like in Google Sheets:
I want to be able to set a value to the value associated with variable c
Right now, the only way ive made it work is by using something like
{{ gsheet['2'].value }}, but i want it to depend on the variable name (since the gsheet order might eventually change, and i dont want it to depend on the index value, if that makes sense).
Since it appears that gsheet is an indexed array, you should be able to to return the necessary information by using a find() or filter() function of the array, possibly like:
gsheet.filter(row => row.value === 'c')[0]
depending on how you access the column data per row (I am unsure of the right syntax for the Gsheet query)
Appreciate the response! It doesnt look like filter() or find() are available functions for me to use (dynamicVariables is the gsheet resource im using)
I had to do some testing because I haven't worked with the Google Sheets resource before, but it seems to return an object in the form of { index: { column_a: 'value_a', column_b: 'value_b' } }. This means that it's already well-formatted for querying with SQL.