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

Remove

Removes the argument in a given string.

{{ "BE0.524.802.662" | remove:"BE" }}
Output
0.524.802.662

Replace

Replaces the argument_1 by argument_2 in the given string.

{{ "Comm.VA" | replace:".","" }}
Output
CommVA

Upcase

Turns all letters of the string in capital letters

{{ "Silverfin" | upcase }}
Output
SILVERFIN

Downcase

Puts all letters of the string in small letters.

{{ "Silverfin" | downcase }}
Output
silverfin

Capitalize

Turns the first letter of the string into a capital letter.

{{ "silverfin" | capitalize }}
Output
Silverfin

Append

Attaches the argument string after the given string.

{{ "Tim Vandecasteele" | append:” with a representative” }}
Output
Tim Vandecasteele with a representative

Prepend

Attaches the argument string before the given string.

{{ "9050 Ledeberg" | prepend:"B - " }}
Output
B - 9050 Ledeberg

Size

Returns the numbers of characters in a string.

{{ "BE0.524.802.662" | size }}
Output
15

Strip

Removes all whitespaces before and after a given string (it doesn't remove spaces between words).

{{ "   BE0.524.802.662   " | strip }}
Output
BE0.524.802.662

Default

This allows to set a default value when a variable or [linkto database variable]database variable[endlinkto] is nil, false or empty

📘

{% assign company_form = company.company_form | default:”NV” %}
Let's say that the database variable company.company_form has not been inputted any value in the company settings

{{ company_form | default:"NV" }}
Output
NV

Minus

Using a minus will remove initial zeros.

Without minus:

{{ "01/01/2018" | date:"%d %B %Y" }}

With minus:

{{ "01/01/2018" | date:"%-d %B %Y" }}
Output
Without minus:

01 January 2018

With minus:

1 January 2018

Today

To the date of today, you can do the following:

{{ "now" | date:"%d/%m/%Y" }}

Localized Date

If you need to display a date according to the time-zone from where template is being executed, you can used the "localized_date" filter.

🚧

This date will be only shown in the user's browser, but won't be exported to the PDF file.

{{ "now" | localized_date:"%d/%m/%Y %H:%M" }}

Slice

Gives a substring of a given string, beginning from a certain index that can be given as well the length of the substring.

{{ "BE0.524.802.662" | slice:4, 11 }}
Output
524.802.662

Newline_to_br

This filter will replace every newline character ("\n") in a string with an HTML line break tag ("<br />").

{% capture welcome_string %}
Hello,
World!
{% endcapture %}

{{ welcome_string | newline_to_br }}
Output
<br />
Hello,<br />
World!<br />

String_value

Values are stored as string, but whenever a variable or drop is called, Silverfin will try to infer it's type (string, number, etc). In some situation we could prefer to avoid this and render the value always as a string.

{% input custom.some.field %}

Value: {{ custom.some.field }}
String value: {{ custom.some.field.string_value }}
Output

Url_encode

Replaces any URL-unsafe character with three characters: a percent sign and the corresponding Hex value of the character replaced.

{{ "[email protected]" | url_encode }}
Output
user%40email.com

Url_decode

Decodes a string that has been encoded by url_encode. It will replaces the Hex values with URL-unsafe characters.

Updated 3 months ago

String


Suggested Edits are limited on API Reference Pages

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