# Check if response value is null, download link when no longer null

**URL:** <https://community.postman.com/t/check-if-response-value-is-null-download-link-when-no-longer-null/37797>\
**Category:** Help Hub\
**Tags:** tests, collections, json\
**Created:** [August 2, 2022, 3:37pm UTC](https://community.postman.com/t/check-if-response-value-is-null-download-link-when-no-longer-null/37797 "2022-08-02T15:37:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacecraft-observer7](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@spacecraft-observer7](https://community.postman.com/u/spacecraft-observer7)\
**Post date:** [August 2, 2022, 3:37pm UTC](https://community.postman.com/t/check-if-response-value-is-null-download-link-when-no-longer-null/37797/1 "2022-08-02T15:37:06Z")

</div>

Is it possible to add a test script to postman to loop the call then automatically download the **reportAccessSecureLink** once it is populated in Postman? This link does not appear instantly in the return body and returns null for about 5-25 min until populated with the link. I have a created a postman flow and would like to automate this to a daily download to a network drive.

This is how the response is initially returned…

![image](https://us1.discourse-cdn.com/getpostman/original/2X/4/41ac4327c2f4b247818ba9ca6e595dc695e35f35.png)

When the report is ready…

```auto
{
    "value": [
        {
            "executionId": "fefc3037-7a70-4210-9732-223a9b1e4429",
            "reportId": "89d5ac38-41bb-44a9-b11e-93c575b7fad1",
            "recurrenceInterval": -1,
            "recurrenceCount": 1,
            "callbackUrl": null,
            "callbackMethod": null,
            "format": "csv",
            "executionStatus": "Completed",
            "reportLocation": "https://pxanltx.blob.core.windows.net/programmatic-export-pi/Azure Usage_xxxxxxx.csv",
            "reportAccessSecureLink": "https://pxanltx.blob.core.windows.net/programmatic-export-pi/xxxxxxxx",
            "reportExpiryTime": null,
            "reportGeneratedTime": "2022-07-26T15:04:39Z"
        }
    ],
    "nextLink": null,
    "totalCount": 1,
    "message": null,
    "statusCode": 200,
    "dataRedacted": false
}

```

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [August 3, 2022, 10:00am UTC](https://community.postman.com/t/check-if-response-value-is-null-download-link-when-no-longer-null/37797/2 "2022-08-03T10:00:17Z")

</div>

Hi @spacecraft-observer7

Off the top of my head, you could look at setting up 2 monitors.  
One to run the initial request and the second to download the report.  
You could then set the monitors to run once a day 20-30 minutes apart.

---

<div class="post-metadata">

**Author:** ![spacecraft-observer7](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@spacecraft-observer7](https://community.postman.com/u/spacecraft-observer7)\
**Post date:** [August 3, 2022, 2:20pm UTC](https://community.postman.com/t/check-if-response-value-is-null-download-link-when-no-longer-null/37797/3 "2022-08-03T14:20:42Z")

</div>

Thanks @w4dd325, I’ve never utilized an api call to download from a response. How is that configured? I guess I’m having more issues downloading the report at this point.

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [August 3, 2022, 6:03pm UTC](https://community.postman.com/t/check-if-response-value-is-null-download-link-when-no-longer-null/37797/4 "2022-08-03T18:03:34Z")

</div>

Not done it myself but I would guess that this “send and download” option might help;

![image](https://us1.discourse-cdn.com/getpostman/original/2X/8/892b020aea60926efce5c7a894b31814692a4885.png)

The blue “send” button has a little arrow next to it where you can select this option.

–

Alternatively, you could have a look at this link (there is a “run in postman” button);

> **[Write Responses To File](https://documenter.getpostman.com/view/3407886/RWgp1fB5)**
>
> This collection makes it easy for users who want to write the response of each request to a file.
> This can be extended to write anything for eg. meta information or value of variables being used.
> 
> 
> This project is using a powerful feature built in...
