# Can't get HUBL Split function working properly

**URL:** <https://community.hubspot.com/t/cant-get-hubl-split-function-working-properly/2498>\
**Category:** CMS Development\
**Created:** [June 23, 2017, 10:16am UTC](https://community.hubspot.com/t/cant-get-hubl-split-function-working-properly/2498 "2017-06-23T10:16:07Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [June 23, 2017, 3:33pm UTC](https://community.hubspot.com/t/cant-get-hubl-split-function-working-properly/2498/11 "2017-06-23T15:33:24Z")

</div>

@mikemaynard, I still don’t understand where the contact.industry is coming from. If you are constructing it yourself or if it is an actual system variable outputting actual system information, but here is the deal:

The reason split is not working on your first example is because it is an ARRAY, not a string. I just tested it and this is 100% a fact. You cannot, nor do you need to, use the split filter on an array. You can use it on an item of an array, but not on the array itself.

What you are attempting to do with the split filter is fake an array out of a string. This works in your second example because it is a string but is NOT necessary in your first example because it is already a 100% real array. You don’t need to split it.

I took the list of industries you gave me and I created an array:

`{% set string_to_split = ["Media", "Marketing", "Advertising", "Sales", "Digital", "Web", "PR", "CPC", "SEO"] %}`

I then loop through the array:

```auto
 <ul>
{% for industry in string_to_split %}
 <li>{{ industry }}</li>
{% endfor %}
</ul>

```

and the output is this:

```auto
<ul>
 <li>Media</li>
 <li>Marketing</li>
 <li>Advertising</li>
 <li>Sales</li>
 <li>Digital</li>
 <li>Web</li>
 <li>PR</li>
 <li>CPC</li>
 <li>SEO</li>
 </ul>

```

while this:

```auto
{% set names = string_to_split|split(';', 9) %}
<ul>
{% for name in names %}
 <li>{{ name }}</li>
 {% endfor %}
 </ul>

```

produced this:

```auto
<ul>
 <li>[Media, Marketing, Advertising, Sales, Digital, Web, PR, CPC, SEO]</li>
</ul>

```

If you are playing with data coming from the Hubspot system, chances are the data is set up to be an array, not a string, while the values of the array keys could be strings, ints, etc. This being the case, if content.industry is in fact hubspot system data, just treat it as a array, not a string.

if contact.industry is your own creation, make it an array. there is no point in going through the trouble of filtering a string to act like an array when you can just use an array from the start. I have created very in depth and complicated dict arrays in hubspot that work wonderfully in terms of output so the sky is the limit if you treat your data right.

---

_[View the full topic](https://community.hubspot.com/t/cant-get-hubl-split-function-working-properly/2498)._
