Validation message with parameter

I have a script code that checks if calculated balance is greater than given value.
I want to show message informing that the balance is too small.
For example:
Your current balance 956.56 is not sufficient. Please fund your account to continue.

In your script, in addition to returning the key, you also need to return parameters, like so:

return [{
            'key': 'balanceNotSufficient',
            'parameters': [calculatedBalance, 'Your current balance {0} is not sufficient']
        }]

remember to use the passed parameter in ‘Tłumaczenia’ tab in the form editor.
image

If you have completed all the steps, you should see the effect on the form.
image

1 Like