How to use the if Conditions Element

use a PHP variable in a ChronoForms if Conditions Element.

Overview

The issue is incorrect syntax when referencing a PHP variable within the CF if Conditions Element.
To use a variable from PHP code, reference it as {var:php_action_name} where 'php_action_name' is the name of your PHP action. Alternatively, explicitly set the variable within your PHP code using the provided method and then reference it as {var:var_name} in the condition.

Answered
ChronoForms v6
to tobre 30 Jan, 2021
Based on the result of a query I set a variable in PHP.
$isDuplicate = 0;
or
$isDuplicate = 1;

How can I use it in the if Conditions Element?

I tried
{var:isDuplicate} equals 0
{var:php2.isDuplicate} equals 0
{data:isDuplicate} equals 0

What is the correct syntax to use a variable or a posted field of a form in the if Conditions Element?
Max_admin Max_admin 03 Feb, 2021
Answer
if the variable is 'returned" by the php code then it's available under {var:php_action_name}

or just set it:
$this->set("var_name", value);
then use {var:var_name}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.