Buy Now
Sign in

Save to DB with if statement

arampro , January 10 at 15:26
A
arampro
Hi,
I've a form, which saves some fields in the database. It works!
Using "save data" It stores the data into DB correctly.
What I need, is an if-statement for one af the values.


created:{date:Y-m-d H:i:s}
catid:3
created_by:591
title:{data:title}
introtext:{data:introtext}
plugins:{"extra_img":"{data:myimage}"}


Is it possible to have if-statement for the last line. So..
if {data:myimage} is not empty then
plugins:{"extra_img":"{data:myimage}"}
else nothing.

Is this possible?
Thx in advance,
Aram
GreyHead
Hi Aram,

You can use a Custom Code action before the save to set a default value for the plugins entry.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much