[HELP] Parse Json with formula inside square brackets



1) Give a description of the problem
I want to parse a json with a lot of data (weather each 5 minutes for the day). So I want to parse the last hour only and its not even sure that the data represent 1 hour (if web request is done close from midnight). I would like to use a formula inside the square bracket that represent the index of the data… Something like:

so if the data is enough it will gives the last hour but if not it will give the latest data. The only thing is that when I use this formula like this it doesnt works


It looks like we could not use formula inside those brackets (I tried to simply use sum(2,2) and the last bracket turned red…



Create a variable, set it equal to the formula, then use that variable inside the brackets.


yes, I tried it and it works but I was trying to make it directly in the expression… Is there a way to define a temporary variable inside the expression? Like: test= my formula; $response.observations…[test] ?


No. You’ll need to create and set the variable equal to the formula either in the body of the piston or in the “define” variables section at the top.


ok! thanks!