Forums

Save to DB with if statement

arampro 10 Jan, 2018
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 15 Jan, 2018
Hi Aram,

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

Bob
This topic is locked and no more replies can be posted.