21 Jul 2023 04:53 PM - edited 21 Jul 2023 05:17 PM
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 error
Thanks
Solved! Go to Solution.
31 Jul 2023 02:11 PM - edited 31 Jul 2023 02:30 PM
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);
}