# Looping through For loop items in DQL Query in Workflow

**URL:** <https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775>\
**Category:** Automations\
**Tags:** dql, workflows\
**Created:** [January 17, 2025, 6:27am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775 "2025-01-17T06:27:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhijitmorye](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@abhijitmorye](https://community.dynatrace.com/u/abhijitmorye)\
**Post date:** [January 17, 2025, 6:27am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775/1 "2025-01-17T06:27:02Z")

</div>

Hello Team,I am trying&nbsp;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&nbsp;to create.Workflow -&nbsp;

 ![abhijitmorye_0-1737095143840.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/efae9409d80568c72acb8e010ae32018703ed493.png)  
Execute DQL Query Result -&nbsp;  
 ![abhijitmorye_1-1737095143843.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/f/6f888f193763c1a8e0eb2d3e238073ce4e198d84.png)  
Davis Analyzer Task Query -  
 ![abhijitmorye_2-1737095143848.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/f/df8f4c06c64d4219227b9bd24093ef7ee4246418.png)

Thanks,

Abhijit Morye

---

<div class="post-metadata">

**Author:** ![christian\_kreuz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_kreuz/32/21669_2.png) [@christian\_kreuz](https://community.dynatrace.com/u/christian_kreuz)\
**Post date:** [January 17, 2025, 7:02am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775/2 "2025-01-17T07:02:37Z")

</div>

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 [Build workflows — Dynatrace Docs](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/building#task-options) for details about loops.

---

<div class="post-metadata">

**Author:** ![abhijitmorye](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@abhijitmorye](https://community.dynatrace.com/u/abhijitmorye)\
**Post date:** [January 17, 2025, 7:09am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775/3 "2025-01-17T07:09:35Z")

</div>

Hi Christian,

Thanks for the reply.

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

 ![abhijitmorye_0-1737097752559.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/2/c260cf3e2ea0f0287d74d7ed3947bb9795692325.png)

Thanks,

Abhijit M.

---

<div class="post-metadata">

**Author:** ![christian\_kreuz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_kreuz/32/21669_2.png) [@christian\_kreuz](https://community.dynatrace.com/u/christian_kreuz)\
**Post date:** [January 17, 2025, 7:14am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775/4 "2025-01-17T07:14:20Z")

</div>

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](https://global.discourse-cdn.com/dynatrace/original/3X/8/9/8926586f9f4eda344f16a8a71fd9d0f6319d1317.png)

---

<div class="post-metadata">

**Author:** ![abhijitmorye](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@abhijitmorye](https://community.dynatrace.com/u/abhijitmorye)\
**Post date:** [January 17, 2025, 7:25am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775/5 "2025-01-17T07:25:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![abhijitmorye](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@abhijitmorye](https://community.dynatrace.com/u/abhijitmorye)\
**Post date:** [January 17, 2025, 7:44am UTC](https://community.dynatrace.com/t/looping-through-for-loop-items-in-dql-query-in-workflow/49775/6 "2025-01-17T07:44:28Z")

</div>

Hi Christian,

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