# Using Multiselect As A Filter + Query Variable

**URL:** <https://community.weweb.io/t/using-multiselect-as-a-filter-query-variable/3064>\
**Category:** How do I?\
**Created:** [June 14, 2023, 9:02pm UTC](https://community.weweb.io/t/using-multiselect-as-a-filter-query-variable/3064 "2023-06-14T21:02:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuildLikePeter](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/buildlikepeter/32/2674_2.png) [@BuildLikePeter](https://community.weweb.io/u/BuildLikePeter)\
**Post date:** [June 14, 2023, 9:02pm UTC](https://community.weweb.io/t/using-multiselect-as-a-filter-query-variable/3064/1 "2023-06-14T21:02:08Z")

</div>

I have a multi select field that I am using to filter a repeating list. Is there a way to map those selected fields to a query variable? And then subsquently map the query variable to the initial values of the multi-select if the page is navigated to directly?

I figured I can set a workflow for “On Change” to populate a query variable. But if the query variable gets updated to include the array of multselect options it doesn’t show up in the url.

I tried setting the query variable to a comma seperated text of the array items using the ToText() function. But then I can’t figure out how to translate that back into an array when needed.

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [June 15, 2023, 3:16pm UTC](https://community.weweb.io/t/using-multiselect-as-a-filter-query-variable/3064/2 "2023-06-15T15:16:27Z")

</div>

You’ll need to URL encode the querystring, as array notation `[]` isn’t valid for a URL. One way you could do this though, is by joining array elements to a string as you said, with a delimiter like `-` and then split the querystring on this delimiter to get back an array.
