# Problem concat query with variable

**URL:** <https://community.hubspot.com/t/problem-concat-query-with-variable/68838>\
**Category:** CMS Development\
**Created:** [November 8, 2022, 7:06pm UTC](https://community.hubspot.com/t/problem-concat-query-with-variable/68838 "2022-11-08T19:06:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thibauls](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/thibauls/32/30597_2.png) [@thibauls](https://community.hubspot.com/u/thibauls)\
**Post date:** [November 8, 2022, 7:06pm UTC](https://community.hubspot.com/t/problem-concat-query-with-variable/68838/1 "2022-11-08T19:06:39Z")

</div>

I am trying to change the query dynamically with value from contact (quote\_number) The problem is that hubl does not want me to concat string with variable.

Spoiler

THIS IS WORKING with hard coding

{% set associated\_soumission = crm\_associations((request\_contact.contact\_vid), “USER\_DEFINED”, 18, “quote\_number=11223344”, “id”, true) %}

Spoiler

THIS IS NOT WORKING with contact property

{% set associated\_soumission = crm\_associations((request\_contact.contact\_vid), “USER\_DEFINED”, 18, “quote\_number=”~contact.quote\_number, “id”, true) %}

Is there a solution?  
I have the same problem with crm\_object.

It’s not really useful if I can’t go and get different values for each contact.

---

<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:** [November 9, 2022, 3:04pm UTC](https://community.hubspot.com/t/problem-concat-query-with-variable/68838/2 "2022-11-09T15:04:39Z")

</div>

Usually with these function calls, if you’re using variables for the query, you have to first build the query outside of the call and then use a variable containing that query for the call itself.

Something like this:

```lia-code-sample
{% set query = "quote_number="~contact.quote_number %}
{% set associated_soumission = crm_associations((request_contact.contact_vid), "USER_DEFINED", 18, query, "id", true) %}

```
