Adding Results Tag to Fori

Hi Team,

We want to add a Results tag to the following code to allow us to show the SIC code(s) for a company in another reconciliation and also as part of an insight.
Any help as to how we do this would be greatly appreciated.

|Relevant SIC code(s):
{% fori item in company.custom.investments %}
{% if forloop.index != 1 %}|{% endif %}
|{% input item.SIC %}
|{% if forloop.index == 1 %}{% ic %}{::infotext}Get this from Companies House{:/infotext}{% endic %}{% endif %}
{% newline %}
{% endfori %}

Kind Regards

Hi @JohnF,

I understand you want to create a result tag for every iteration of your fori loop. You will have to add a result tag inside the {% fori %} ... {% endfori %} and make sure that the result name is unique for every loop by using a dynamic name.

You can find more information on how to create a result-tag for each loop:

And here’s some more information to explain why you should use dynamic name for the result in this case:

Feel free to reach out if you have additional questions.

Kind regards,
Kimberly

result result-tags fori_loop

Hi Kimberly,

Thanks for the advice, I’ll try and find the help I require from the links you provided.

Regards

John F.