How to set default value for form?

Hi, I would like to ask if I can easily set a default value for a field in the Form view?

More specifically, I would like to have the ability to dynamically set a default value, like when I’m recording my expenses, I would like it to be able to autofill today. I tried to use the today’s formula but then I lost the ability to modify that.

Another use is suppose I have two very related field, e.g. one is estimated cost one is actual cost. I would like to fill the estimated cost then the default for actual cost field is set to what I’ve just entered. I would like to ask if such design is possible. I’m open to write script, so maybe if it needs some script and you know about the basic workflow, I would kindly ask for some material related to that.

Thanks for the help

Hi @LumenYang,

unfortunately, at the moment it’s not possible to dynamically set a default value in a form based on other values or some custom js scripts.

What you can do now in Baserow is accept an empty field in the form and then add a formula field with something like: if(isblank(field('date')), field('Created on'), field('date')), where ‘Created on’ is the name of a ‘Created on’ field.

Another alternative could be to create your own form or use some other low-code tool to create the form with your custom logic and integrate it with Baserow APIs.

My colleague @Alex suggested another option: create/find a browser extension that lets you define custom logic to fill the form.

This will work only for you and with that specific browser extension activated, but if it’s just for your personal workflow, it might be easier than writing your own web frontend logic and it’s more flexible than the Baserow formula based on empty values.