# How get JSON in Workflows and work on it in the next task

**URL:** <https://community.dynatrace.com/t/how-get-json-in-workflows-and-work-on-it-in-the-next-task/44964>\
**Category:** Automations\
**Tags:** workflows\
**Created:** [April 2, 2024, 4:52pm UTC](https://community.dynatrace.com/t/how-get-json-in-workflows-and-work-on-it-in-the-next-task/44964 "2024-04-02T16:52:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge3229](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@Jorge3229](https://community.dynatrace.com/u/Jorge3229)\
**Post date:** [April 2, 2024, 4:52pm UTC](https://community.dynatrace.com/t/how-get-json-in-workflows-and-work-on-it-in-the-next-task/44964/1 "2024-04-02T16:52:14Z")

</div>

Hello, good day, I am starting to work with the workflows, in the example that I am building I make an http request, which results in a JSON file, which is what interests me since it brings all the data I need, my question is how can I get that json and work on it in the next task, I was reviewing the documentation and I see a result function but I can’t quite understand how it works, I don’t know if anyone has a similar example, thank you very much in advance

 ![Captura de pantalla 2024-04-02 104518.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/78c682b718e146185b137c4cdc271c9cd7b247b6.png)  
 ![image.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/0/60abf2c0d2d4c3d97a1ffd420f1c883b46a191ee.png)

---

<div class="post-metadata">

**Author:** ![jose\_araya](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jose\_araya](https://community.dynatrace.com/u/jose_araya)\
**Post date:** [April 2, 2024, 9:45pm UTC](https://community.dynatrace.com/t/how-get-json-in-workflows-and-work-on-it-in-the-next-task/44964/2 "2024-04-02T21:45:56Z")

</div>

Hola Jorge, let me see if I can help a bit.

You can access the results of the previous steps using the following expressions:

> **[Jinja expressions for Workflows](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/reference)**
>
> Get to know the Jinja templating and expressions for Workflows.

You can use this syntaxis inside the options and parameters of the following steps.

If the returned object has attributes or more properties you can access them as well using something like:

**{{ result(‘task\_1’).foo }}**

Works as well when working with JSON objects. Most of the tasks return a JSON result object.

If you need to work with the previous results inside a Javascript task and code, you can work with something like in this example:

> **[Forecast disk and resource utilization](https://docs.dynatrace.com/docs/dynatrace-intelligence/use-cases/dynatrace-intelligence-for-workflows)**
>
> Automate predictive maintenance of cloud resources with Dynatrace Intelligence within AutomationEngine.

As you can see you can store the resulting object from a previous task, or even create a new array to store the whole results. In that example they use:

**const TASK\_ID = ‘predict\_disk\_capacity’; //here you put the name of the previous task**

**const predResult = await exe.result(TASK\_ID); //store the whole result in a new variable**  
**const result = predResult[‘result’]; //a new variable to store only the result part**

Then you can work with&nbsp; **result** to traverse it or access any particular value.

Best regards,

Jose David.

---

<div class="post-metadata">

**Author:** ![trevordconsult](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@trevordconsult](https://community.dynatrace.com/u/trevordconsult)\
**Post date:** [April 1, 2025, 3:31pm UTC](https://community.dynatrace.com/t/how-get-json-in-workflows-and-work-on-it-in-the-next-task/44964/3 "2025-04-01T15:31:19Z")

</div>

Hey all, I am following up on this thread. I am working on creating a workflow that automatically queries the Dynatrace Dashboards API. That will get a list of dashboards and their respective IDs. I want to then take it and get all the dashboard JSON files to then upload them to gitlab.

I am currently getting the full list of dashboards, but I am having trouble taking that “dashboards.json” file and passing it to the next task. I have uploaded the json in the result in the following task. I have added a screenshot here. Let me know if anyone else has tried to do this!

 ![trevordconsult_0-1743521466062.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/b/6bc144c179c03f48e3277cc0dff63bd86cd9196e.png)
