# Circular Reference

**URL:** <https://community.silverfin.com/t/circular-reference/2047>\
**Category:** Templates\
**Created:** [March 15, 2021, 1:21pm UTC](https://community.silverfin.com/t/circular-reference/2047 "2021-03-15T13:21:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mhairi](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Mhairi](https://community.silverfin.com/u/Mhairi)\
**Post date:** [March 15, 2021, 1:21pm UTC](https://community.silverfin.com/t/circular-reference/2047/1 "2021-03-15T13:21:12Z")

</div>

I have 2 templates that refer to each other and are creating a circular reference. I’m trying to find a way to bypass using “result”.

The Template A is a recon template which calculates a total from the underlying account templates. Currently the total of these amounts is assigned to a register:

|{%=$1+ account.value | currency %}  
|{%=$3+ account.value-account.results.amount\_1%}  
|{%=$4+ account.results.amount\_2%}

The totals are then added to a result:

{% result ‘total\_item\_1’ $3 %}  
{% result ‘total\_item\_2’ $4 %}

Template B then populates the results from Template A into a table.

```
  {{-period.reconciliations.template_A.results.total_item_1|currency }}
  {{-period.reconciliations.template_A.results.total_item_2|currency }}

```

The Total of the table in Template B is then added to a result and that total is used for a separate calculation in Template A:

{{period.reconciliations.template\_B.results.tableTotal|currency}}

So because the total in template B is using amounts from template A, I cannot get the total from template B back into template A.

Is there any way around this?

---

<div class="post-metadata">

**Author:** ![pgallagher](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/pgallagher/32/1576_2.png) [@pgallagher](https://community.silverfin.com/u/pgallagher)\
**Post date:** [March 15, 2021, 8:40pm UTC](https://community.silverfin.com/t/circular-reference/2047/2 "2021-03-15T20:40:43Z")

</div>

I haven’t used the Account templates myself yet.

But I am wondering if you could just do the three calcs below in Template B (as well as Template A still. Just won’t be needing to use the result tags). Since they all come from an account template. Instead of bringing the total in as a result from Template A —\> Template B, you just do these same calcs in Template B.

|{%=$1+ account.value | currency %}  
|{%=$3+ account.value-account.results.amount\_1%}  
|{%=$4+ account.results.amount\_2%}

If this is possible - then you should still be able to get the total of the table in Template B w/o using any result tags from Template A. And you can then just bring the total table result tag from Template B → into Template A.

---

<div class="post-metadata">

**Author:** ![Mhairi](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Mhairi](https://community.silverfin.com/u/Mhairi)\
**Post date:** [March 17, 2021, 11:05am UTC](https://community.silverfin.com/t/circular-reference/2047/3 "2021-03-17T11:05:49Z")

</div>

That worked perfectly. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [March 22, 2021, 8:46am UTC](https://community.silverfin.com/t/circular-reference/2047/4 "2021-03-22T08:46:55Z")

</div>

Closed on March 22, 2021, 8:46am UTC


