# Is there any way to access to the result of any previous task in Workflow using DQL instead of JS code?

**URL:** <https://community.dynatrace.com/t/is-there-any-way-to-access-to-the-result-of-any-previous-task-in-workflow-using-dql-instead-of-js-code/50608>\
**Category:** DQL\
**Tags:** dql, workflows\
**Created:** [March 7, 2025, 4:04am UTC](https://community.dynatrace.com/t/is-there-any-way-to-access-to-the-result-of-any-previous-task-in-workflow-using-dql-instead-of-js-code/50608 "2025-03-07T04:04:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![waikeat\_chan](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/waikeat_chan/32/33405_2.png) [@waikeat\_chan](https://community.dynatrace.com/u/waikeat_chan)\
**Post date:** [March 7, 2025, 4:04am UTC](https://community.dynatrace.com/t/is-there-any-way-to-access-to-the-result-of-any-previous-task-in-workflow-using-dql-instead-of-js-code/50608/1 "2025-03-07T04:04:17Z")

</div>

Just to give an example of what I encountered, I have a simple workflow below consists of task\_1 and task\_2.

You can see that in task\_1 the DQL return a single record:

 ![Task 1 Fine.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/e/5e4a0cf073f77b7b14fe7669755fc55660ab2472.jpeg)

What I want to do in task\_2, is to run another DQL where it would consists of the ApplicationID return by the result/record of task\_1. But somehow I couldn’t 👇

 ![Task 2 Not Okay.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/3/a3fed18e8789c1fc9d019d099dfe430cb4d437b2.png)

**Not quite sure what is wrong with my syntax anyway, because if I use _{{result(‘task\_1’)}}_ it is fine; use _{{result(‘task\_1.waikeat’)}}_ it isn’t fine**&nbsp; &nbsp;(but then, if I don’t use task\_1.waikeat how am I suppose to pass the ApplicationID to the DQL of task\_2?)

Best Regards,

Wai Keat

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [March 7, 2025, 8:48pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-access-to-the-result-of-any-previous-task-in-workflow-using-dql-instead-of-js-code/50608/2 "2025-03-07T20:48:38Z")

</div>

The output of task\_1 will be a record whose fields you cannot refer to directly in a subsequent task. I think you need to add a step in task\_2’s DQL query to first create a new field containing the output from task\_1 and then doing the filter logic.

**Sample DQL**

```markup
fetch dt.entity.service
| fieldsAdd task_1_result = {{result('task_1'}}
| // insert your filter here with new reference to task_1_result.waikeat

```

It’s a bit of a hack, bit should hopefully get the job done.
