Default value in setRelation dropdown for Add action

How can I set default (or empty) value for a dropdown in add state that it comes from a setRelation?
Like this (GroceryCrud 2.0.2 version)

Thanks!

1 Like

“The issue here is that if the field is not NULLable (e.g. accept NULL value) is showing a dropdown and the first one is always selected. So I am using the empty field only if the field can also take NULL value. It works fine if making the field to accept NULL in the database. If you don’t want to have NULL as value in the database you will need to make sure that this field will need to be required with: requiredFields | Grocery CRUD” txs Johnny

2 Likes