Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By Somayeh
#829485
Hi guys. I defined a checkbox in my form and get it with @= in a trigger , also I defined it boolean in database , but in database I always see 0 or zero , when it checked or unchecekd . How can I solve my problem?
By Somayeh
#829487
Hi , i define a boolean variable in my form. its name is chkxstatusAks , then i define a trigger:

$db='5552845836131e996ab9677075960874';
$chkxstatusAks = @=chkxstatusAks;

$query = "INSERT INTO `eaa` (`Id`, `chkxstatusAks`)VALUES (NULL,'$chkxstatusAks');";
$result = executeQuery($query,$db);

and i created a table by the name of eaa in database and a column for chkxstatusAks and its type is BOOLEAN . and when i run my process, my checkbox(chkxstatusAks) always saves 0 in db , checked or unchecked.
User avatar
By kirkwg
#829488
Hi

You can't directly accessing the checkbox with @=, you need to check its value?
docs link: https://wiki.processmaker.com/3.1/Checkbox_and_Checkbox_Group#Accessing_a%20Checkbox_with_PHP

Try the trigger php code:
Code: Select all
//if checkbox is marked:
if (isset(@=chkxstatusAks) and @=chkxstatusAks ==  array(1)) {
    $chkxstatusAks = 1;
}
else { //if unmarked:
   $chkxstatusAks = 0;
}
$query = "INSERT INTO `eaa` (`Id`, `chkxstatusAks`)VALUES (NULL,'$chkxstatusAks');";
$result = executeQuery($query,$db);

Try and see, thanks.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]