# GET parameter with array

**URL:** <https://community.hubspot.com/t/get-parameter-with-array/107037>\
**Category:** CMS Development\
**Created:** [May 13, 2024, 6:18pm UTC](https://community.hubspot.com/t/get-parameter-with-array/107037 "2024-05-13T18:18:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoFiks](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rofiks/32/202358_2.png) [@RoFiks](https://community.hubspot.com/u/RoFiks)\
**Post date:** [May 13, 2024, 6:18pm UTC](https://community.hubspot.com/t/get-parameter-with-array/107037/1 "2024-05-13T18:18:03Z")

</div>

Hi there,

Hopefully somebody can help me out! I’m trying to retrieve a GET variable with an array, but I can’t figure out how to do this. The query string is something like [domain.com/projects?project](http://domain.com/projects?project)\_type%5B%5D=name&project\_type%5B%5D=name2

I tried things like request.query\_dict.project\_type and request.query\_dict[‘project\_type[]’], but I only seem to retrieve the first GET variable.

Could somebody help me out how to do this in HubL? Thanks for your help!

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [May 13, 2024, 7:06pm UTC](https://community.hubspot.com/t/get-parameter-with-array/107037/2 "2024-05-13T19:06:44Z")

</div>

@RoFiks - I may have the wrong interpreation of your question here, but it seems like you may be trying to retrieve a query string value that represents a multi-value property. You definitley can’t do this by repeating the query string. Have you tried using the formula of passing a composite string that looks like “valuea;valueb;valuec” - that is using semicolons to seperate out the individual values. This is often how such properties are represented in the UI.

Steve

---

<div class="post-metadata">

**Author:** ![RoFiks](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rofiks/32/202358_2.png) [@RoFiks](https://community.hubspot.com/u/RoFiks)\
**Post date:** [May 15, 2024, 7:22am UTC](https://community.hubspot.com/t/get-parameter-with-array/107037/3 "2024-05-15T07:22:23Z")

</div>

Hi Steve,

Thanks for helping! I thought it was possible to retrieve multiple values also with creating an array, but isn’t this the case?

Without the urlencode it would look like: [domain.com/projects?project](http://domain.com/projects?project)\_type[]=name&project\_type[]=name2, which would give a GET variable with an array(name, name2).  
Your solution to create a string instead of an array would definitily work, thanks! I was just wondering if it would be possible to retrieve an array from a GET variable with HubL as well 🙂

---

<div class="post-metadata">

**Author:** ![phlp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/phlp/32/23809_2.png) [@phlp](https://community.hubspot.com/u/phlp)\
**Post date:** [February 10, 2025, 11:47am UTC](https://community.hubspot.com/t/get-parameter-with-array/107037/4 "2025-02-10T11:47:49Z")

</div>

@RoFiks With some hubl-magic you can do this.

I don’t understand why this isn’t supported out of the box, but here you go:

`$project_types = request.query|split('&')|select('containing', 'project_type' )|join('&')|replace('project_type=', '')|split('&')`
