# Modify query param in pre-request script

**URL:** <https://community.postman.com/t/modify-query-param-in-pre-request-script/8880>\
**Category:** Help Hub\
**Tags:** pre-request\
**Created:** [November 8, 2019, 3:33pm UTC](https://community.postman.com/t/modify-query-param-in-pre-request-script/8880 "2019-11-08T15:33:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bbrowske-LD](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bbrowske-LD](https://community.postman.com/u/bbrowske-LD)\
**Post date:** [April 14, 2020, 10:59pm UTC](https://community.postman.com/t/modify-query-param-in-pre-request-script/8880/3 "2020-04-14T22:59:17Z")

</div>

So I’m pretty new to postman scripting, but I think this might work for you. If I know the index of my parameter to update, as it seems you are wanting to do, I have been successful with

`pm.request.url.query.idx(0).value = "newValue";`

---

_[View the full topic](https://community.postman.com/t/modify-query-param-in-pre-request-script/8880)._
