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

Get results from pervious workflow

Jingyi
Observer

Hi

In Workflow, there are three types of Execution: Execute DQL Query, HTTP Request, Run Javascript. If I use HTTP Request for task1 and have the response. How can I get this response result to use in next tasks, if next task uses Javascript? I tried with the ref Expression reference | Dynatrace Docs but still get errorcapture.png

Thanks

1 REPLY 1

samuelbernardy
Dynatrace Enthusiast
Dynatrace Enthusiast

res will need to be declared here. For example: 

 

const res = ex.result('http_request_1')

 

 

Also, keep in mind that in javascript, the result function is called via the current execution. While you may use the template string {{ result() }} from within an HTTP request for instance, you are importing the execution and result modules, which would require you to write the declaration as such: 

 

 

export default async function({execution_id}) {
  const ex = await execution(execution_id); 
  const res = await ex.result('http_request_1');
  console.log(res);
}

 

Featured Posts