Sadler
Member
Hi,
I need to run an upsert on a form submission but only when one of the other fields is not zero (it is a drop down field and can only be 1 or 0, it defaults to 0).
I am trying to achieve this using the condition on the upsert plugin, here is what I have in the condition field:
On testing it the upsert is not running regardless of the drop down value, I am not sure that I am accessing the submitted form data correctly, I am using some code snippets I found elsewhere in the wiki.
Anyone have some experience on this to share or spot an obvious blunder.
Cheers
Burnsy
I need to run an upsert on a form submission but only when one of the other fields is not zero (it is a drop down field and can only be 1 or 0, it defaults to 0).
I am trying to achieve this using the condition on the upsert plugin, here is what I have in the condition field:
Code:
$Upsert = $formModel->formData['my_table___my_field'];
if ($Upsert > 0) {return true;}
else
{return false;}
On testing it the upsert is not running regardless of the drop down value, I am not sure that I am accessing the submitted form data correctly, I am using some code snippets I found elsewhere in the wiki.
Anyone have some experience on this to share or spot an obvious blunder.
Cheers
Burnsy