How to pull data from a reconciliation to appear next to each other on a different reconciliation

Hi, I was wondering how to pull data from two datapoints on one reconciliation to be next to each other on a second reconciliation? Currently the code I am using is this:

image

Currently this is pulling the Nature of Relationship headings to be under the Name instead. Could someone please have a look at the above code to see where I am going wrong?

Thanks in advance.

Rory

Hi Rory,

Welcome to the Silverfin community!

One way of solving this issue is to update the result tag in your source file so that only one array is put in a result tag.

{% assign array = "name1|nature1;name2|nature2;name3|nature3" %}

{% result 'datapoints' array %}

As you can see the array actually has 2 delimiters: ; to split the different datapoints and | to split the name and nature of each datapoint. In your destination template the code can look like this:

{% assign datapoints_array = period.reconciliations.related_party_transactions_rec | split:";"  %}

{% for datapoint in datapoints_array %}
  {% assign datapoint_items = datapoint | split:'|' %}
  {% for item in datapoint_items %}
    |{{ item }}
  {% endfor %}
  {% newline %}
{% endfor %}

I hope this answers your question.

Kind regards,
Michiel

Thanks Michiel,

I’m just having a look at updating the source file now, the current code is this:

image

Am I correct in thinking that I need to update the code with the first bit you mentioned to be within the {if item.persisted %} section?

Thanks

Rory

Hi @rory.grant ,

Now I see the source template I wonder what you exactly want to transfer from the source to the destination template?

If you want to loop over custom collection custom.r (defined in the source template) in the destination template, you could simply loop over it without having to create result tags, which are a bit slower from a performance perspective. In the destination file the code could be as follows:

{% for item in period.reconciliations.handle_source_template.custom.r %}
  |{{ item.name }}
  |{{ item.relationship }}
{% endfor %}

I hope this answers your question?

Kind regards,

Michiel

Thank Michiel, that’s all worked now :slight_smile: