Optional Duration Field Causes Error When Left Empty

Hello,

I’m experiencing an issue with a Duration field in Baserow.

In my application form, this field is optional and may sometimes be left empty by the user. However, when no value is provided, it seems to generate an error instead of being accepted.

What I would like is for an empty Duration field to automatically be interpreted as 0d (zero days), or at least to be accepted without causing a validation error.

Is there a recommended way to configure a Duration field so that empty values default to 0d? Alternatively, is there a best practice for handling optional Duration fields in forms?

I already tried : if( is_empty( Data_Duration) , “0d” , Data_Duration)

But it wasn’t successfull…

Thank you for your help.

Hey @Luc13, what is the error you’re seeing?

“Value error for field “Duration”: The value is not a valid duration”

Hey @Luc13, are you using the SaaS version or self-hosting Baserow?

And is this happening in the Application Builder or in a Form view within the Database Builder?

Saas Version and from the App builder.

Hi @Luc13 ,

Could you use the “value” field? It represents the “default” / “initial” value. If you set it to 0d, then if the value is left blank, we’ll default to that.

Cheers,

Peter

Hi Peter,

I already tried the field value with 0d / “0d” / '0d / 0 , nothing works. It really look like a bug…

Any other idea ?

Thank’s
Lucas