Cross-company data

It is possible to access company, account and template data from other companies.

Manage company links

In the edit client section on company level, company links can be managed. The data sharing link is a one-way link, data isn't automatically shared both ways.

Users can only add links to other companies where the users have access to. However, once selected every user can see the data that is pulled from the other company.

Access external data in templates

External company data

Specific external company data can be accessed in templates. This can accessed though the external_companies method on the company drop.

{% for company in company.external_companies %}  
  {{ company.name }}  
  {{ company.id }}  
{% endfor %}

External company collection

The input type external_company_collection allows the user to select from which companies they want to get data from in the particular template. This input type works as any other input and supports attributes such as required, default and companies_var.


❗️

Matching periods

Important to note that it is only possible to fetch external data in case the end periods match.


Access external data in templates

In Liquid, template authors can use the selected external companies from the external_company_colletion as range for the company.external_companies drop or loop through the companies_var to access the external data.

{% input custom.external.companies as:external_company_collection companies_var:linked_companies  %}
{% assign selected_external_companies = company.external_companies | range:custom.external.companies %}

THROUGH DROP
{% for comp in selected_external_companies %}
  comp: {{ comp }}
  name: {{ comp.name }}
  id: {{ comp.id }}
{% endfor %}

COMPANIES_VAR
{% for comp in linked_companies %}
  c: {{ comp }}
  name: {{ comp.name }}
  id: {{ comp.id }}
{% endfor %}
Output

Period data

Cross-company period data can be accessed, such as accounts and reconciliations data.

  {% assign external_accounts = comp.period.accounts.include_zeros | range:external_accounts_selected %}
  {% for account in external_accounts %}
    {{ forloop.index }} - {{ account.number }} - {{ account.name }}  - {{ account.link }}
  {% endfor %}

External account collection

The input type external_account_collection allows the user to use accounts data from external companies in the particular template. The external_account_collection works the same as a regular account_collection, all attributes that exist for the account_collection are also supported for the external_account_collection, apart from the company default attribute that is required to be added. Also the UI of the external account collection is similar to the regular account collection (i.e. same icon and similar modal to select accounts).



The external account collection only accepts one company default (i.e. you can only select accounts from one company in the modal).

{% for comp in selected_external_companies %}
  {% input custom.external.account as:external_account_collection range:6,7 default:6              company:comp accounts_var:linked_accounts %}
{% endfor %}

Accounts data

Certain methods from the accounts drop can be accessed from external companies. The external accounts drop is nested under the company.period drop.

{% for comp in selected_external_companies %}
  {% input custom.external.account as:external_account_collection range:6,7 default:6 company:comp accounts_var:linked_accounts %}
  {% assign external_accounts_selected = custom.external.account | default:6 %}
  
  {% assign external_accounts = comp.period.accounts.include_zeros | range:external_accounts_selected %}
  {% for account in external_accounts %}
    {{ forloop.index }} - {{ account.number }} - {{ account.name }}  - {{ account.link }}
  {% endfor %}
{% endfor %}
Output

Reconciliation data

All results can be accessed from external companies. Results from other templates can be accessed, but also from the same template (but from another company of course).

The syntax is similar to accessing results within a company, the only difference is that the data is nested in the external_company drop.

{% for comp in selected_external_companies %}
    result: {{ comp.period.reconciliations.reconciliations_starred.results.robin }}
{% endfor %}

🚧

Circular references

Circular references should not be made. Circular references occur when template A calls a result value from template B, while template B references a result value from template A. In case of cross-company data, the issues may occur when results of the same template from company A are used in company B, and vice-versa.

Dependency chains

Accessing results from other companies add another layer to the dependency chain. It is therefore of the utmost importance to take this into account in the template architecture. More information on dependency chains and cache can be found here.