Question

Return json array element id

  • 24 April 2024
  • 1 reply
  • 11 views

Userlevel 2
Badge +1

I am trying to build a workflow that will read the data in a google sheet search for a specific value then update fields in that row. The issue I am having is that the Google Sheets API does not have the ability to search for a value and return that row. What I can do is ready the entire sheet out as json with each row being an array.

 

What I am wanting to do in fresh service is bring that json into a parser then search for my specific data and get the json path so i would have something along the lines of $.values[47]. From there I should be able to be able to figure out the coordinates for the specific cells I need to update.

 

Here is some sample json from a dummy sheet, how would I retrieve the address for the value “456”

{
"range": "Sheet1!A1:F1000",
"majorDimension": "ROWS",
"values": [
[
"Field 1",
"Field 2",
"Field 3"
],
[
"foo",
"123",
"abc"
],
[
"bar",
"456",
"def"
],
[
"bin",
"789",
"ghi"
],
[
"baz",
"321",
"jkl"
]
]
}

 


1 reply

Userlevel 7
Badge +13

You can use JSON path queries in the parser node but they are static. 
Question if it can be used. 

Reply