# Changing a dropdown on page load to match page query

**URL:** <https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340>\
**Category:** How do I?\
**Created:** [July 3, 2023, 9:46pm UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340 "2023-07-03T21:46:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yunus](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yunus/32/3122_2.png) [@yunus](https://community.weweb.io/u/yunus)\
**Post date:** [July 3, 2023, 9:46pm UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340/1 "2023-07-03T21:46:07Z")

</div>

Hey all…

I have a list companies that from an Airtable collection \> **LIST**  
And I am generating reports for each on a static page \> **/r/?cID=company-name**  
Company’s are referred by a Company ID parameter **(cID)** and I am using them as query for the page URL to load the relevant company. (at least in theory - but because page is not loading what i want, this is a problem)

I have a big dropdown on the report page, which acts as the company title on the report page. This is a design choice to encourage people to explore other companies…

My problem is; on page load, I am not able to update the dropdown to take the cID and assign it as the selected object for the dropdown.

Changing that dropdown works fine manually… But I want to load a default value for it on page load.

Any ideas? Or other suggestions to establish this logic?

 ![Screenshot 2023-07-03 at 22.42.01](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/96a4f465bf9f475a9eaf2535db5bcb844e09ebc8.png)

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [July 4, 2023, 11:02am UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340/2 "2023-07-04T11:02:31Z")

</div>

Hi @yunus

Have you tried binding the initial value of the select?

 ![CleanShot 2023-07-04 at 13.01.19@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0d9ace7a8541a2ee3afdf68957d2beeb8cb8f107.png)

I’m thinking that might do the trick but not 100% sure 🙂

---

<div class="post-metadata">

**Author:** ![yunus](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yunus/32/3122_2.png) [@yunus](https://community.weweb.io/u/yunus)\
**Post date:** [July 4, 2023, 11:41am UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340/3 "2023-07-04T11:41:09Z")

</div>

I did, but it doesn’t seem to work.  
Not sure why but still tinkering all combinations, none worked so far…

Just trying the local storage setting for cID parameter… will let you know.

 ![Screenshot 2023-07-04 at 12.36.17](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/049ef5336fe1614d765d52addd2fbd39389b181f.png)

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [July 4, 2023, 7:35pm UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340/4 "2023-07-04T19:35:28Z")

</div>

Mmm ok. Is there anything confidential in your app? If not, a short video of what you tried would be great! Might help us find the right approach for this use case

---

<div class="post-metadata">

**Author:** ![yunus](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yunus/32/3122_2.png) [@yunus](https://community.weweb.io/u/yunus)\
**Post date:** [July 4, 2023, 10:45pm UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340/5 "2023-07-04T22:45:46Z")

</div>

I found my issue, there was a lookupArray that i forgot to trigger, fixed it now. but thanks.  
also sent you the project links… you can see it in action. Currently fixed… links working, page loading as intended. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [July 4, 2023, 10:48pm UTC](https://community.weweb.io/t/changing-a-dropdown-on-page-load-to-match-page-query/3340/6 "2023-07-04T22:48:58Z")

</div>

Wonderful! Nicely done 😀
