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

Looping through For loop items in DQL Query in Workflow

abhijitmorye
Newcomer_
Hello Team,
 
I am trying to create a workflow where I am executing the Davis Analyzer Task using DQL query, In the previous task, I am using the DQL Task which will return the list of records, now in Davis Analyzer Task, I am using For loop option which will iterate over the list of records and execute the task accordingly, I am trying to use the for loop variable in my Davis Analyzer Query, However I am getting an saying "Field {{._item }} does not exit". Please find the below snapshots for the task that I am trying to create.
 
Workflow - 
abhijitmorye_0-1737095143840.png

 

 
Execute DQL Query Result - 
 
abhijitmorye_1-1737095143843.png

 

 
Davis Analyzer Task Query -
 
abhijitmorye_2-1737095143848.png

 

Thanks,

Abhijit Morye

5 REPLIES 5

christian_kreuz
Dynatrace Advisor
Dynatrace Advisor

Hi,

on a first glance this looks alright. Can you please add a screenshot of the "Options" tab of the analyze_with_davis_1 task? I suspect that something might need to be changed on that tab.

See https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/building#task-options for details about loops.

abhijitmorye
Newcomer_

Hi Christian,

Thanks for the reply.

Please find the below snapshot for the Option in Davis Analyzer Task.

 

abhijitmorye_0-1737097752559.png

Thanks,

Abhijit M.

 

Hi Abhijit, and for the Options Tab itself? Does it look like this? Specifically the Item variable name needs to be item, if you want to reference it with {{ _.item }}

christian_kreuz_0-1737098045127.png

 

Yes, I have kept variable name as item and using this variable as {{ _.item }} in DQL query as suggested.

abhijitmorye
Newcomer_

 Hi Christian,

I got the answer for this, correct way to use jinja variable in DQL is "{{ _.item }}". Thanks for your prompt response.

Featured Posts