Defining the default value of a boolean

  • Asked
  • Active
  • Viewed 5718 times
0

Hi,

I would like my field "confident in pct tree cover in cropland?", which is a boolean, to be false/"no" if the response to "confident in pct area in cropland?" (also a boolean) is false/"no" because if we are not sure of the cropland area, we cannot be sure that we have the right percent tree cover in cropland.

I cannot make it work... In the default value for "confident in pct tree cover in cropland?", I am using lulc[lulc='high_forest']/lulc_cfdce = 1 for "applied when" but I am unable to get the boolean value (in expression? in constant value?) to be set at false then.

Thanks VERY MUCH for any help!

Best,

Florence

0

Accepted answer

When using the validation expressions try to compare the ouput of logic expressions with the value false() and true() instead of 0 and 1, that should work. So the expression would be:

lulc[lulc='high_forest']/lulc_cfdce = true()

Not sure how to make sure it comes to you, so here it is also :-)...

Thanks for the first answer! Now, I want to assign a default value of "false" to "high_forest_pct_treecover_cfdce" when "lulc[lulc='high_forest']/lulc_cfdce = false ()".

How can I assign "false" to "high_forest_pct_treecover_cfdce"?

Many, many thanks!!!

flandsberg flandsberg
0

Accepted answer

Fantastic, it works in terms of the relevance!!

But now, I want to assign a default value of "false" to "high_forest_pct_treecover_cfdce" when "lulc[lulc='high_forest']/lulc_cfdce = false ()".

How can I assign "false" to "high_forest_pct_treecover_cfdce"?

MMMMMMMMMMMMMMMMany thanks!!!

0

Accepted answer

Default values for boolean variables and simply FALSE or TRUE (in capital letters).

Hi,

Thanks for helping me out.

If I put as default value "FALSE" in "constant value" and "lulc[lulc='high_forest']/lulc_cfdce = false ()" in "Apply when", it does not work... Meaning, the default value of high_forest_pct_treecover_cfdce is not becoming "false" when lulc_cfdce for high_forest is "false" (note that lulc_cfdce is in a table).

Where is my error?

Thanks,

Florence

flandsberg flandsberg
0

Accepted answer

Dear Florence,

sorry I gave you premature information. This default value for boolean attribute works in Collect, not yet in Collect Earth. That issue will be taken into account when developing future version of CE. Thanks, Lauri

0

Accepted answer

Hello,

A follow up on this. Has this been included in Collect Earth yet? I tried again and it does not seem to work.

Thanks,

Florence

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Tip: type a few words from the error message, or put a tag in [brackets] to look only there.

Menu

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.