how do I create a condition that if the field is empty, the row is written to the database?I can't write it using event switch or if condition
Forums
condition
{data:fieldname/default_value_if_field_missing} which is slightly different to if the field is there but empty
Could always use a switch: {data.empty:fieldname} and in true put your default value and false just {data:fieldname}
Could always use a switch: {data.empty:fieldname} and in true put your default value and false just {data:fieldname}
I also invented a solution, but it doesn't work for me. can you advise me?
in logis PHP is
in logis PHP is
if($this->data["kurz"] =='1'): $hop='1';and in event switcher: https://jmp.sh/A9bfJec, but I don't see the message
else : $hop='2';
endif;
return $hop;
I don't see where you set $hop or gave it a value in the first condition
I set $hop inside if else
You sure did, which means it's not available outside of that else.
Either use a switch with conditions 1 and * (in that order) or
Or for your code
if($this->data("kurz"))
return 1;
else
return 2;
Or for your code
$hop = ''; // Set this outside of the condition
if($this->data('kurz') == 1)
$hop = 1;
else
$hop = 2;
return $hop;
Thanks a lot for your help, it works for me.
I wouldn't think of using parentheses instead of square brackets.
Also, because it was a deep night with us, I made other mistakes there.
I wouldn't think of using parentheses instead of square brackets.
Also, because it was a deep night with us, I made other mistakes there.
This topic is locked and no more replies can be posted.