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

Concat

Concat (concatenates) tag allows to combine number of arrays. The final array will contain all the elements of the original arrays. It is important to note that the duplicate entries will not be removed from the combined final array unless you use the uniq filter.

{% assign fixed_assets = "buildings,land,computer equipment" |split:"," %}
{% assign intangible_assets = "goodwill,patents,trademarks" |split:"," %}

{% assign assets = fixed_assets |concat:intangible_assets %}

{{ assets |join:", " }}
Output (arrays)
buildings, land, computer equipment, goodwill, patents, trademarks

It can be also applied to collections, as shown in the example below.

{% fori item in custom.items1 %}
  {% input item.name %}
  {% input item.category %}
{% endfori %}

{% fori item in custom.items2 %}
  {% input item.name %}
  {% input item.value %}
{% endfori %}


{% assign items = custom.items1 | concat:custom.items2 %}

{% for item in items %}
  {{ item.name }}
  {{ item.category }}
  {{ item.value }}
{% endfor %}
Output (collections)

Split

Will split up a string into an array with the given argument.

{% assign used_acc_numbers = "610000;610015;610023;610045" | split:";" %}

{% for acc in used_acc_numbers %}
  {{ acc }}
{% endfor %}
Output
610000

610015

610023

610045

First

Returns the first item of an array.

{% assign used_acc_numbers = "610000;610015;610023;610045" | split:";" %}

{{ used_acc_numbers | first }}
Output
610000

Last

Outputs the last item of an array.

{% assign used_acc_numbers = "610000;610015;610023;610045" | split:";" %}

{{ used_acc_numbers | last }}
Output
610045

Join

Will join each element of an array with the argument.

{% assign used_acc_numbers = "610000;610015;610023;610045" | split:";" %}

{{ used_acc_numbers | join:" & " }}
Output
610000 & 610015 & 610023 & 610045

Sort

Will sort an array.

{% assign active_directors = "Tim;Joris;Sven" | split:";" %}

{{ active_directors | sort | join:" "  }}
Output
Joris Sven Tim

Size

Will return the numbers of characters of a given string or give the number of items in an array. This filter can also be used as a [linkto methods]method[endlinkto].

{% assign active_directors = "Tim;Joris;Sven" | split:";" %}

{{ active_directors | size  }} or {{ active_directors.size  }}
Output
3 or 3

Uniq

Will return unique elements of an array.

{% assign my_accounts = "610000,610023,610045,610000" | split:"," %}

{{ my_accounts | uniq | join:", " }}
Output
610000, 610023, 610045

Where

Will create an array including only the objects that meet the established condition.

{% assign genders = "Female|Male|Other" %}
{% fori people in custom.people %}
  |{% input people.name %}
    |{% input people.gender | as:select | options:genders %}
{% endfori %}

{% assign women = custom.people | where:'gender','Female' %}

{% for woman in women %}
  {% if forloop.last %}{% assign names = names | append:woman.name | append:"." %}
  {% else %}
  {% assign names = names | append:woman.name | append:", " %}
  {% endif %}
{% endfor %}

Women: {{ names }}
Output

Also, the community provides a great example of how to use the "where" filter.

Updated 9 months ago

Array


Suggested Edits are limited on API Reference Pages

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