CASE: fetch entries from budgets

:warning: This feature is hidden behind a feature flag. Reach out to your CSM if you want to already enable this.

With the exposure of budget data in liquid, we can now access budget entries and show them in our Silverfin templates. :new_button:

Because budgets only exist on a company level, we don’t know which budget a user wants to display data from. In most cases we will want to present the user with a dropdown so they can choose the budget they want to see data from themselves.

We can fetch the available budgets and use their handles and names to create the dropdown.

{% comment %}create empty arrays for budget selection{% endcomment %}
{% assign budget_names = "" | split:"|" %}
{% assign budget_handles = "" | split:"|"  %}

{% comment %}populate budget names and handles arrays{% endcomment %}
{% for budget in period.budgets %}
  {% push budget.name to:budget_names %}
  {% push budget.handle to:budget_handles %}
{% endfor %}

{% comment %}add pipes so the arrays can be used as options and option_values{% endcomment %}
{% assign budget_names = budget_names | join:"|" %}
{% assign budget_handles = budget_handles | join:"|" %}

{% comment %}input for budget selection{% endcomment %}
{% input custom.forecasting.budget_selection as:select options:budget_names option_values:budget_handles %}

Next we want to know for which period they want to see the budgeted amounts for.

Screenshot 2026-09-16 at 11.29.39

Let’s again offer a dropdown, with a choice of the upcoming 2 periods.
Note that a period does not have to exist yet in Silverfin in order to budget for it.

{% comment %}create empty arrays for period selection{% endcomment %}
{% assign period_display = "" | split:"|" %}
{% assign period_value = "" | split:"|" %}

{% push "plus_1p" to:period_value %}
{% push period.plus_1p.end_date to:period_display %}

{% push "plus_2p" to:period_value %}
{% push period.plus_2p.end_date to:period_display %}

{% comment %}add pipes so the arrays can be used as options and option_values{% endcomment %}
{% assign period_value = period_value | join:"|" %}
{% assign period_display = period_display | join:"|" %}

{% comment %}input for period selection{% endcomment %}
{% input custom.forecasting.period_selection as:select options:period_display option_values:period_value %}

Now we have all the information we need to fetch relevant data from the budget.

{% comment %}fetch the chosen period{% endcomment %}
{% assign chosen_period = custom.forecasting.period_selection.string_value %}

{% comment %}fetch the chosen budget{% endcomment %}
{% assign chosen_budget = period.[chosen_period].budgets[custom.forecasting.budget_selection] %}

{% comment %}if a budget and period are selected, fetch the accounts{% endcomment %}
{% if custom.forecasting.budget_selection != blank and custom.forecasting.period_selection != blank %}
    {% for budget_entry in chosen_budget.entries %}
    {{ forloop.index }} - {{ budget_entry.number }} - {{ budget_entry.name }} - {{ budget_entry.value }}
  {% endfor %}
{% endif %}

We can also fetch the budgeted entry for a specific account range.

{{ chosen_budget.entries.["2"] }}
{{ chosen_budget.entries | range:"2" }}

Curious to learn from you which use cases you have for this new feature :light_bulb: