'Question about using API to retrieve cell data

I’m wondering if someone could help me figure out a little issue I’m having. I’m trying to create an iOS shortcut to retrieve specific cell data from a Google Sheets document, and I’m really close, however, I’m hitting this snafu.

For my example, the data entered into the specific cell is: “0+ 5” (without the quotes).

I’m using the following URL to grab the data (with my string ID and API keys X’d out):

https://sheets.googleapis.com/v4/spreadsheets/XXXXXXXXXX/values/Sheet1!D#?key=XXXXXXXXXXXXXXXXX

(Also, the # character after “Sheet1!D” is purposeful….I have shortcuts configured to replace that character with a number I input when running the shortcut)

Anyway, the result I’m getting is:

{"range":"Sheet1!D99","majorDimension":"ROWS","values":[["0+ 5"]]}

Notice the “0+ 5” near the end, which is the data entered in the specific cell.

I know I can mess around with Regex to to have the shortcut specifically match that part of the text, but I’m assuming there’s a way to format the API URL so that it only gives me the data entered — in this case, only

0+ 5

and not all of the other info….am I correct in that assumption? If so, I’d rather go that route and have the shortcut be a bit less convoluted.

Thanks!



Solution 1:[1]

Server's response is in JSON format, meaning, you can use action Get Dictionary From Input and next use action Get Dictionary Value. Type in values for the key.

Check this image:

enter image description

Hope this helps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lemon