# Request.query\_dict value syntax

**URL:** <https://community.hubspot.com/t/request-query-dict-value-syntax/67202>\
**Category:** CMS Development\
**Created:** [October 14, 2022, 10:43pm UTC](https://community.hubspot.com/t/request-query-dict-value-syntax/67202 "2022-10-14T22:43:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmcmillan99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tmcmillan99/32/93181_2.png) [@tmcmillan99](https://community.hubspot.com/u/tmcmillan99)\
**Post date:** [October 14, 2022, 10:43pm UTC](https://community.hubspot.com/t/request-query-dict-value-syntax/67202/1 "2022-10-14T22:43:32Z")

</div>

I can’t remember the correct syntax for pulling just the value from request.query\_dict.  
I have the following code:

```lia-code-sample
{% if request.query_dict.tags is not undefined %}
{% set cat = request.query_dict.tags|split(',') %}
<div class="blog-index__tag-header">
<h4 class="blog-index__tag-heading">Category: {{ cat|replace('-',' ') }}</h4>
</div>
{% else %}

```

The results are rendered with the brackets and I want to eliminate the brackets.

![tmcmillan99_0-1665787286711.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/5/d5738483b76c05511dd286282ef546664b0ab461.png)

I appreciate the assistance.  
Thanks,

Terry

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [October 15, 2022, 2:56am UTC](https://community.hubspot.com/t/request-query-dict-value-syntax/67202/2 "2022-10-15T02:56:14Z")

</div>

@tmcmillan99

What |split does is take an input string and turn it into a list and this is why it has the brackets. You could easily just remove |split and it’ll return the same output but without the brackets.

`{% set cat = request.query_dict.tags %}`

If there’s a particular reason you’re using |split then you’ll need a for loop to loop through the list and output each tag individually.

```lia-code-sample
{% set categories = request.query_dict.tags|split(',') %}
<div class="blog-index__tag-header">
 <h4 class="blog-index__tag-heading">
 Category: 
 {% for cat in categories %}
 {{ cat|replace('-',' ') }}{% unless loop.last %}, {% endunless %}
 {% endfor %}
 </h4>
</div>

```

---

<div class="post-metadata">

**Author:** ![tmcmillan99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tmcmillan99/32/93181_2.png) [@tmcmillan99](https://community.hubspot.com/u/tmcmillan99)\
**Post date:** [October 17, 2022, 12:58am UTC](https://community.hubspot.com/t/request-query-dict-value-syntax/67202/3 "2022-10-17T00:58:05Z")

</div>

@alyssamwilie

Thanks for the correction on the syntax. It’s exactly what I was looking for and gave me some new understanding on Hubl filters.

Terry
