In the model environment, some variables are created for each input parameter, which can be used by algorithms.
The name of those variables is automatically assigned from the description of the parameter when it is created. For instance, in this model:
New variables are being created with the names of the inputs, converted to lowercase and removed special characters.
The value of those variables can be returned through the var( )
function (it is in General group):
I think that an input parameter can be created with a "variable friendly" description, and then the description could be changed to another "user friendly" one to be shown in the run dialog.
In your screenshot can be seen that you have an input parameter named Drained Solis? [leave u..., and you were trying to return its value from the following name string: 'drainedsoilsleaveuncheckedifnotsure'
, so you are close to what you need.
The string is not equal to a boolean true, so the condition is evaluated to false.
Your expression may be:
if(
var('drainedsoilsleaveuncheckedifnotsure') = True,
replace("GDCodeTemp", '/D', ''),
replace("GDCodeTemp", map('A/', '', 'B/', '', 'C/', '')))
Also, you don't need to evaluate to a boolean True to return a true condition, if the value of the variable is already a boolean.
The value returned by var('drainedsoilsleaveuncheckedifnotsure')
may be the condition.
if( var('drainedsoilsleaveuncheckedifnotsure') = True,replace("GDCodeTemp", '/D', ''),replace("GDCodeTemp", map('A/', '', 'B/', '', 'C/', '')
?