ifEmpty() Formatter set to another column's value
ifEmpty() Formatter set to another column's value
I am looking to set the value to write to the database if an empty string is submitted from the client-side.
If the value for perm_id
is empty, I would like to set the value to default to another required field's projname
value.
I have tried:
Field::inst( 'perm_id' )
->setFormatter( Format::ifEmpty('projname'))
but it does not seem to work. Any ideas? Thanks!
This discussion has been closed.
Answers
Hi @mpalmer ,
Looking at a combination of this thread and this one, this should work:
Cheers,
Colin