# "TypeError: Cannot read property 'links' of undefined" ONLY when using scheduled runs

**URL:** <https://community.postman.com/t/typeerror-cannot-read-property-links-of-undefined-only-when-using-scheduled-runs/41437>\
**Category:** Help Hub\
**Tags:** runner, typeerror, scheduler\
**Created:** [November 24, 2022, 9:59am UTC](https://community.postman.com/t/typeerror-cannot-read-property-links-of-undefined-only-when-using-scheduled-runs/41437 "2022-11-24T09:59:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vegconomist](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vegconomist](https://community.postman.com/u/vegconomist)\
**Post date:** [November 24, 2022, 9:59am UTC](https://community.postman.com/t/typeerror-cannot-read-property-links-of-undefined-only-when-using-scheduled-runs/41437/1 "2022-11-24T09:59:11Z")

</div>

_My question_:  
I have a folder with 4 GET requests where I write out the results into variables using “Tests”.  
**Running them individually or the whole folder with the Runner works flawlessly.**  
**BUT, when I schedule the runs, I always get the following error:**  
_TypeError: Cannot read property ‘links’ of undefined_

I have absolutely no clue what could be different, when I run the folder scheduled rather than manually.

_Details (like screenshots)_:  
**GET request**  
[https://api.rasterwise.com/v1/get-scrape?url=https://www.website.com&extract=links,images&scope=.class](https://api.rasterwise.com/v1/get-scrape?url=https://www.website.com&extract=links,images&scope=.class)

**Response body**

```auto
{
    "status": "success",
    "pageStatus": 200,
    "scrapeDate": "2022/11/24",
    "results": {
        "scopedto": ".class",
        "links": [
            {
                "text": "",
                "host": "example.com",
                "url": "https://example.com/",
                "radiusContext": {
                    "parentText": "test",
                    "nextSiblingText": "test"
                }
            }
        ],
    }
}

```

**Test**  
let response = pm.response.json();  
pm.environment.set(“variable”, response.results.links[0].url);

---

<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:** [November 25, 2022, 9:37am UTC](https://community.postman.com/t/typeerror-cannot-read-property-links-of-undefined-only-when-using-scheduled-runs/41437/2 "2022-11-25T09:37:04Z")

</div>

Hi @vegconomist

How are you scheduling the runs?

---

<div class="post-metadata">

**Author:** ![vegconomist](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vegconomist](https://community.postman.com/u/vegconomist)\
**Post date:** [November 29, 2022, 2:22pm UTC](https://community.postman.com/t/typeerror-cannot-read-property-links-of-undefined-only-when-using-scheduled-runs/41437/3 "2022-11-29T14:22:22Z")

</div>

Hi @w4dd325  
by going to the collection \> Run collection \> Schedule runs (Periodically run collection at a specified time on the Postman Cloud.)

I finally found the issue, it is about the handling of Authorization.  
When running it manually in the Collection Runner it used the credentials from the Collections’ Authorization-tab.

But apparently the Postman Cloud is not. Because as soon as I added the credentials (API key) to the get request URL it worked.

Hopefully this is helpful to someone as well.
