Customizing the default error message

Hello,

So i’m using the value validation in order to check the length of a couple fields.
Obviously when trying to update the record the user is hit with the error, as well as the message i have set up.
My problem here is it’s an error message, which is not user friendly
image
How could I customize the error into a friendlier message.

Suggestions ?

Thanks

1 Like

Hello
You can use this workflow for Error handling. It’s like a try catch operator.

2 Likes

Thanks for your response.

I would love some guidance on how i can customize the error message further
image

The first letter is not capital, and of course i dont want to show the ({“field”:“field_name”})

I think in your case it’s better to use “value-validators” on your text fields:

https://docs.cortezaproject.org/corteza-docs/2023.9/integrator-guide/compose-configuration/index.html#value-validators

1 Like

Using a workflow Error step will let you customize the message.

Thanks a lot for you response, yes the screenshot above is a result of the error step workflow + field validation, but i’m unable to customize things like not showing : ({“field”:“field_name”}), could you please guide me more in-depth on how to really really tailor the message.

This is the error step, what you write here will be shown
image

Or you can use a prompt

Appreciate your answers.

I prefer the error step as it forbids the persisting of the data.

Im using the error variable, currently.
image

Lets say i want to write my own message, but i still need dynamic things like field names for example. How can I isolate the field’s names from the errorMessage variable ?

You would have to parse the string in an expression.
https://docs.cortezaproject.org/corteza-docs/2023.9/integrator-guide/expr/fnc-reference.html

Dont remember such a request before so you’re threading new ground. But I’m sure the error object can be parsed and the necessary data can be extrapolated out.

1 Like