The screen shot of the max query response does not balance its JSON brackets {}.
Can you grab the JSON and post it as text?
From what I see, the decode sequence would be …
set global dictResponse to decode json as dict (webResponseContent)
set global rowsWhatever to lookup by key “rows” in dictResponse
set global firstRowWhateverDict to select item 1 from global rowsWhatever
set global maxWhatever to lookup by key “max” from global firstRowWhateverDict
set global maxWhatever to global maxWhatever + 1 (edit)
I am betting rowsWhatever will never be empty. Add your own error checking.
Two other approaches using some blocks from the dictionaries drawer:
Flatten the rows into a list with the list by walking key path block, which you could then use with the max operator in a loop to find the maximum value:
For the version where you’ve computed the max on the server, you can use the get value at key path to extract the value: