1) Give a description of the problem
I’m making a request for a JSON. It changes every minute and the record I want is always at the end. I can’t get a variable to work when writing the expression.
2) What is the expected behaviour?
I’m taking the length of the array to get the last value:
set variable lastRecord
= $response.length
from there, I’m just trying to get the last record, but it’s not coming though.
$response[lastRecord]
3) What is happening/not happening?
$response[lastRecord]
is retuning NULL
$response[160]
returns the value, but I need the latest as it refreshes every minute
**4) Post a Green Snapshot of the piston!
5) Attach logs after turning logging level to Full
4/17/2020, 9:31:27 AM +449ms
+1ms ╔Received event [In meeting].switch = on with a delay of 223ms
+79ms ║RunTime Analysis CS > 19ms > PS > 41ms > PE > 18ms > CE
+81ms ║Runtime (41157 bytes) successfully initialized in 41ms (v0.3.110.20191009) (79ms)
+82ms ║╔Execution stage started
+91ms ║║Comparison (enum) on is (string) on = true (1ms)
+93ms ║║Cancelling condition #2’s schedules…
+94ms ║║Condition #2 evaluated true (7ms)
+96ms ║║Cancelling condition #1’s schedules…
+97ms ║║Condition group #1 evaluated true (state changed) (9ms)
+99ms ║║Cancelling statement #3’s schedules…
+107ms ║║Sending external web request to: cloud.iexapis.com/stable/stock/dal/intraday-prices?token=*********************************************
+719ms ║║Executed virtual command httpRequest (613ms)
+725ms ║║Executed virtual command setVariable (3ms)
+730ms ║║181
+731ms ║║Executed virtual command log (1ms)
+737ms ║║null
+738ms ║║Executed virtual command log (1ms)
+744ms ║║[average:24.085, close:24.085, date:2020-04-17, high:24.085, label:12:10 PM, low:24.085, minute:12:10, notional:2553.01, numberOfTrades:2, open:24.085, volume:106]
+745ms ║║Executed virtual command log (1ms)
+747ms ║╚Execution stage complete. (665ms)
+748ms ╚Event processed successfully (748ms)