#✅ Making a field required AND not nullable conditionally

6 messages · Page 1 of 1 (latest)

real wedge
#

My assumption is that this is not possible, since NOT_NULL is an SQL field that applies to a column non-conditionally. However I'll describe by desired use case regardless. I would like to set a filed as required, and also not allowed to have a null value, depending on a condition. Specifically, I have a Video data model. It has a player that can be Vimeo or YouTube. If the editor has entered Vimeo as the type, I want a third field to unhide, and be required, and not allow a null value. I know the database cannot do such things, but can the editor interface?

torn elkBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:

  • An explanation of exactly what you're trying to achieve.
  • Any and all related code or previous attempts.
  • The exact issue or error you are facing.
  • Any screenshots if applicable.

When you're done with this thread, please close it.

(If you have a support agreement and need help, please contact the core team via email.)

slender hazel
#

in the field settings, you would have to allow null value, set the field required to no, and hidden to yes.
in the field conditions, set if player _eq vimeo, no to hidden (double click to remove the default null) and requred to yes (single clikc)

real wedge
#

That would have it be required, but allowing a null value. Which isn't really required, in my opinion, unless I am misunderstanding what allowing a null value actually does. (In my experience in the software, it means that a user does not have to enter a value into the field, which is hard for me to consider required in any way)

real wedge
#

Having just created a new testing model, it looks like the front-end does in fact require the user to enter a value into the field, if it is marked as required, EVEN IF it allows a null value, so I was wrong.

torn elkBOT
#

✅ Making a field required AND not nullable conditionally