Boolean default value

Dear,

I created a boolean in form working_docs with the code below.

{% input custom.boolean.provision as:boolean default:‘true’ %}

In another form I want to use the input of this boolean in an if-function and want that my elsif is fullfilled if the boolean is true (default). The problem is that my elsif is only fullfilled if I untich the boolean first and thick it again but not when I do nothing and leave the boolean at its default value.

So it seems that my if-function does not recognise the default value. Does anyone has a solution for my issue?

{% if period.reconciliations.working_docs.custom.boolean.provision != ‘true’ %}

{% elsif period.reconciliations.working_docs.custom.boolean.provision != ‘false’ %}

Thanks

Hello @marnixcoudre

When a boolean is not ticked, the default value will indeed not be saved. The value of the boolean is blank in the case of a default.

This can be solved by integrating this blank value in your if-function. For example (for use in same template):

{% input custom.boolean.provision as:boolean default:'true' %}
{% if custom.boolean.provision == 'true' or custom.boolean.provision == blank %}
{% elsif custom.boolean.provision == 'false' %}
{% endif %}

For your code could you please try with:

{% if period.reconciliations.working_docs.custom.boolean.provision != 'false' or period.reconciliations.working_docs.custom.boolean.provision == blank %}

Please let us know if this does not solve the issue.

Kind regards,

Mathias

1 Like

Hello,

Is it possible to set the value of a boolean in a reconciliation from the configuration box?

Kind regards
Jasper

Hi Jasper,

In certain cases it’s possible to set the default value of a boolean in a marketplace reconciliation template from the configuration box in your firm.

To be able to do that, the default of an input field must be a local variable. In the configuration box you can then assign a value to that local variable. To find out which input fields in marketplace reconciliation templates are applicable for configuration, I refer to are our support page.

Kind regards,

Michiel