# Using env var with url but fails with parameterization?

**URL:** <https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974>\
**Category:** Help Hub\
**Created:** [February 25, 2022, 10:51pm UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974 "2022-02-25T22:51:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbiles123456789](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@dbiles123456789](https://community.postman.com/u/dbiles123456789)\
**Post date:** [February 25, 2022, 10:51pm UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974/1 "2022-02-25T22:51:28Z")

</div>

This may be specific to the endpoint being used but  
Lets say I have a pre request script that makes the following

`pm.environment.set('randomNumber', number);`  
`pm.environment.set('table',tableName);`

Then in the request URL its a DEL with the following url as example.  
`www.domain.com/table({{tableName}},{{number}})`.  
Assuming this is how the request wants to be formatted then it should work but in my issue I can see that the URL is constructed as such when the request is sent, but fails when using parameterization.

If I take the same request that gets output in the console from the parameterization and use it has a hardcoded url it passes.

Any ideas or help?  
This is the endpoint being used - [Delete Entity (REST API) - Azure Storage | Microsoft Learn](https://docs.microsoft.com/en-us/rest/api/storageservices/delete-entity1)

---

<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:** [February 26, 2022, 8:58am UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974/2 "2022-02-26T08:58:02Z")

</div>

Hi @dbiles123456789

Try removing the rounded brackets and comma from the URL path.

For example;  
`www.domain.com/table{{tableName}}{{number}}`  
or  
`www.domain.com/table/{{tableName}}/{{number}}`

If you specifically need these in the URL then they would most likely need URL encoding;

`www.domain.com%2Ftable%28{{tableName}}%2C{{number}}%29`

---

<div class="post-metadata">

**Author:** ![dbiles123456789](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@dbiles123456789](https://community.postman.com/u/dbiles123456789)\
**Post date:** [February 26, 2022, 3:52pm UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974/3 "2022-02-26T15:52:52Z")

</div>

Sadly, Azure will not allow that to work. That format would make much more sense but…

Again, oddly enough, if I take the entire url that prints to the postman console and use the hardcoded values it works.

I’m not sure if this is on the Azure side or on the postman side

---

<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:** [February 26, 2022, 9:14pm UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974/4 "2022-02-26T21:14:42Z")

</div>

could you share some screenshots? would help visualise what you mean.

---

<div class="post-metadata">

**Author:** ![dbiles123456789](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@dbiles123456789](https://community.postman.com/u/dbiles123456789)\
**Post date:** [March 1, 2022, 6:35pm UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974/5 "2022-03-01T18:35:36Z")

</div>

![Screenshot 2022-03-01 133009](https://us1.discourse-cdn.com/getpostman/original/3X/8/d/8d3bdd9f98d57f2c8a2bd47f5ba9d5ef821d0f56.png)

If you notice the order of the console output here

1. I am able to create a row in a table
2. When I try to delete said row I get a 403 - again this url is dynamical generated in the pre-request script
3. If I copy the generated url and paste in the address bar of postman for the delete request it responds with a 204

Very puzzling as to why a url generated within postman would fail but the same generated url works if used directly with hardcoded values

---

<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:** [March 12, 2022, 9:47am UTC](https://community.postman.com/t/using-env-var-with-url-but-fails-with-parameterization/32974/6 "2022-03-12T09:47:43Z")

</div>

I wonder if it could be related to this…

> <https://github.com/postmanlabs/postman-app-support/issues/4171>
>
> \## App Details:
> \`\`\`
> Postman for Windows
> Version 5.5.2
> win32 10.0.15063 / x64…
> \`\`\`
> \## Issue Report:
> 1. Did you encounter this recently, or has this bug always been there: \*\*Always been there\*\*
> 2. Expected behaviour: I expect Postman to send the request I am asking it to send.
> 
> In Postman I do a GET to http://foo.com?x={123}
> Postman actually sends a GET to http://foo.com/?id=%7B123%7D
> Postman console shows http://foo.com?x={123}
> 
> I understand some people want automatic url encoding but there are times when you have to investigate issues that depend on Postman sending the url without modifying it. Right now I'm dealing with such an issue and I can't use Postman. In my opinion it should be possible to disable automatic url encoding through a setting or button.
