# Assigning company.custom.variable to another variable

**URL:** <https://community.silverfin.com/t/assigning-company-custom-variable-to-another-variable/1362>\
**Category:** Templates\
**Created:** [January 23, 2019, 10:26am UTC](https://community.silverfin.com/t/assigning-company-custom-variable-to-another-variable/1362 "2019-01-23T10:26:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bart\_Verhaeghe](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bart\_Verhaeghe](https://community.silverfin.com/u/Bart_Verhaeghe)\
**Post date:** [January 23, 2019, 10:26am UTC](https://community.silverfin.com/t/assigning-company-custom-variable-to-another-variable/1362/1 "2019-01-23T10:26:51Z")

</div>

Hi there, I have the following problem. This code works fine:

```
{% assign str_EconomischeBegunstigden = "1902141|Frank Vlayen |Muizenhoekstraat|||++1902142|Saskia Schatteman|Muizenhoekstraat|||" %}

{% assign arr_EconomischeBegunstigde = str_EconomischeBegunstigden | split:'++' %}

{% stripnewlines %}

{% newline %}
| {% comment %}kolom 1{% endcomment %}
nr
| {% comment %}kolom 2{% endcomment %}
bron
| {% comment %}kolom 3{% endcomment %}
soort
| {% comment %}kolom 4{% endcomment %}
opmerkingen
| {% comment %}kolom 5{% endcomment %}
Naam
| {% comment %}kolom 6{% endcomment %}
Adres
| {% comment %}kolom 7{% endcomment %}
Geboortedatum
| {% comment %}kolom 8{% endcomment %}
Startdatum
| {% comment %}kolom 9{% endcomment %}
Einddatum

{% newline %}
| {% comment %}kolom 1{% endcomment %}
:--5%--:
| {% comment %}kolom 2{% endcomment %}
:--5%--:
| {% comment %}kolom 3{% endcomment %}
:--5%--:
| {% comment %}kolom 4{% endcomment %}
:--20%--:
| {% comment %}kolom 5{% endcomment %}
:--20%--:
| {% comment %}kolom 6{% endcomment %}
:--20%--:
| {% comment %}kolom 7{% endcomment %}
:--10%--:
| {% comment %}kolom 8{% endcomment %}
:--10%--:
| {% comment %}kolom 9{% endcomment %}
#

{% for EconomischeBegunstigde in arr_EconomischeBegunstigde %}
{% assign EconomischeBegunstigde_Informatie = EconomischeBegunstigde | split:'|' %}
{% assign namespace = EconomischeBegunstigde_Informatie[0] | replace:' ', '_' %}

{% newline %}
| {% comment %}kolom 1{% endcomment %}
{{forloop.index}}
| {% comment %}kolom 2{% endcomment %}
Sync (VGD)
| {% comment %}kolom 3{% endcomment %}
opzoeking
| {% comment %}kolom 4{% endcomment %}

| {% comment %}kolom 5{% endcomment %}
{{EconomischeBegunstigde_Informatie[0]}}

| {% comment %}kolom 6{% endcomment %}
{{EconomischeBegunstigde_Informatie[1]}}

| {% comment %}kolom 7{% endcomment %}
{{EconomischeBegunstigde_Informatie[2]}}

| {% comment %}kolom 8{% endcomment %}
{{EconomischeBegunstigde_Informatie[3]}}

| {% comment %}kolom 9{% endcomment %}
{{EconomischeBegunstigde_Informatie[4]}}

{% endfor %} {% comment %}EconomischeBegunstigde{% endcomment %}

{% endstripnewlines %}

```

First, the split is according to ‘++’, then to ‘|’ (this works fine). However, the following code doesn’t (very similar to the first, except that ‘str\_EconomischeBegunstigden’ is the result of another variable ‘company.custom.EconomischeBegunstigden.DelimitedString’, which is given to the template by an API call.

{% assign str\_EconomischeBegunstigden = company.custom.EconomischeBegunstigden.DelimitedString %}. The variable ‘company.custom.EconomischeBegunstigden.DelimitedString’ has exactly the same contents as ‘str\_EconomischeBegunstigden’, but here, the second split (according to ‘|’ does NOT occur.

Can you help me here?

---

<div class="post-metadata">

**Author:** ![Sofie\_Cleemput](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sofie_cleemput/32/709_2.png) [@Sofie\_Cleemput](https://community.silverfin.com/u/Sofie_Cleemput)\
**Post date:** [January 23, 2019, 3:33pm UTC](https://community.silverfin.com/t/assigning-company-custom-variable-to-another-variable/1362/2 "2019-01-23T15:33:32Z")

</div>

Hi Bart

I took a look at your question, but I’m a little bit confused. Which (part) of the code doesn’t work?  
For now, I only see the code that works fine. Can you paste the code that doesn’t work?

Thanks in advance.

Sofie
