cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I access the "loop" variable in my workflow task?

dt_martin
Dynatrace Enthusiast
Dynatrace Enthusiast

Hello team,

I have a workflow action where I want to loop over an array of locations (lat, long)
I named the item variable "locations" and the list would look something like this.
[{lat: 48.29226713, long: 14.29553878}]

How can I access these values in my HTTP Request?

EDIT: I have tried writing {{locations.lat}} but it doesn't seem to work this way.

EDIT_2: Figured out that my value for the list was malformed (invalid json). Using [{ "lat": 48.29226713, "long": 14.29553878}] works but still don't know who to read those values

1 REPLY 1

michal_zawislak
Dynatrace Helper
Dynatrace Helper

Hi Martin,
To access loop variable with e.g. its name set to locations. You can access it like {{ _.locations.lat }} (mind the _. at the beginning)

2022-12-12 11_27_08-Clipboard.png

2022-12-12 11_34_10-Clipboard.png

Senior Software Engineer @ Dynatrace