# Cannot use variables in GET requests

**URL:** <https://community.postman.com/t/cannot-use-variables-in-get-requests/17110>\
**Category:** Help Hub\
**Created:** [October 26, 2020, 9:29pm UTC](https://community.postman.com/t/cannot-use-variables-in-get-requests/17110 "2020-10-26T21:29:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Sebi](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Sebi](https://community.postman.com/u/Sebi)\
**Post date:** [October 27, 2020, 10:20am UTC](https://community.postman.com/t/cannot-use-variables-in-get-requests/17110/5 "2020-10-27T10:20:27Z")

</div>

Ok. It works after reimporting the data file. But there’s still a problem; it creates requests even when the agent\_id is empty. Is it possible to set conditions on the requests (drop request is variable value if null/empty)?

E.g:

```auto
{
    "url": "http://localhost:3000/users/",
    "gadget_id": "",
    "user_id": "9d788283-87a9-4c38-8d48-30ddc1604058"
},

```

Don’t make request for gadget\_id like

[www.url.com/gadgets/{{gadget\_id}](http://www.url.com/gadgets/%7B%7Bgadget_id%7D)}

gadget\_id is empty so don’t even make the request.

Something like this:

> [@How Can One Terminate Executing a Request From Within Pre-Request Script?](https://community.postman.com/t/how-can-one-terminate-executing-a-request-from-within-pre-request-script/7432):
>
> When I go to execute a request, I use logic within the Pre-request Script to determine IF I really want to execute this request or not based on environment variable settings. I don’t seem to be able to find a way of specifically terminating execution prior to the invocation of the actual API call and subsequent Tests scripts. In short, that is what I want to do, stop prior to the actual API call. I tried using postman.setNextRequest(null) but it doesn’t stop execution at that time and still go…

---

_[View the full topic](https://community.postman.com/t/cannot-use-variables-in-get-requests/17110)._
