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

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

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

 

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

 

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   (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

1 REPLY 1

marco_irmer
Advisor

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

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.

Featured Posts