Silverfin

The Silverfin Developer Hub

Welcome to the Silverfin developer hub. You'll find comprehensive guides and documentation to help you start working with Silverfin as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Collection

Map

This filter will create an array of items taking from a collection using the given argument.

🚧

{{ period.accounts }} is a collection that holds all used accounts of the current period. When adding "613" to it, {{ period.accounts.613 }}, it'll filter down to all used accounts of the given range 613, with info like name, number, value, ...

{% assign used_accounts = period.accounts.613 | map:"number" | join:", " %}

{{ used_accounts }}
Output
613130, 613510, 613540

Range

This will filter an account collection on a specific range given as a argument. The range can be given as a string between double quotes "".

{% assign profit = period.accounts | range:"6,7" %}

{{ profit.value | currency }}
Output
-6,897.00

This will take all inputted years and only filter on the ones that have '2020' in them for that specific database variable 'custom.year'.

Group by

The group_by filter provides the possibility to group items of the collection that have the same value for a specific variable.

{% stripnewlines %}
|----|---|---# {% newline %}
{% fori share in custom.shares %}
  | {% input share.name %}
  | {% input share.type as:select options:"A|B|C" %}
  | {% input share.value as:currency %}
  {% newline %}
{% endfori %}
{% endstripnewlines %}

{% assign grouped_shares = custom.shares | group_by:"type" %}

B aandelen

{% for share in grouped_shares["B"] %}
  {{ share.name }} {{ share.value }}
{% endfor %}

Let's assume that we filled in some data as shown below. Then the above code will give the following result:

Output

You can find an example of the group_by filter on our community.

Index by

The index_by filter makes it possible to access a collection item through another index then you are used to.

The community provides a perfect example on how to implement this.

❗️

When 2 items of a collection have the same index, only the last item will be called upon when that index is used.

Updated 11 months ago

Collection


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.