Representing an Empty String in a display condition

Hello,

I am trying to write a display condition and would like to include an empty
string in the condition. Are single quotes okay? For example if I wrote
display logic as *display question if /data/visit_date = ''. *Would this
work?

Thanks,
James

James,

Yes, that will work.

Cheers,
Will

··· On Wed, Aug 31, 2016 at 8:05 PM, James Tinkamanyire < jamestinkamanyire@gmail.com> wrote:

Hello,

I am trying to write a display condition and would like to include an
empty string in the condition. Are single quotes okay? For example if I
wrote display logic as *display question if /data/visit_date = ''. *Would
this work?

Thanks,
James

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks, William. Can I use this for a date field as well?

··· On Thu, Sep 1, 2016 at 3:11 AM, William Pride wrote:

James,

Yes, that will work.

Cheers,
Will

On Wed, Aug 31, 2016 at 8:05 PM, James Tinkamanyire < jamestinkamanyire@gmail.com> wrote:

Hello,

I am trying to write a display condition and would like to include an
empty string in the condition. Are single quotes okay? For example if I
wrote display logic as *display question if /data/visit_date = ''. *Would
this work?

Thanks,
James

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/commcare-users/1Evid6b1tSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

*James Tinkamanyire *| Data Manager

Measuring Early Treatment Adherence - META ProjectGlobal Health
Collaborative - MUST - Uganda

P.O. Box 1397, Mbarara.

BSc Computer EngineeringMBARARA UNIVERSITY OF SCIENCE & TECHNOLOGYP.O. Box
1410, Mbarara, Uganda.

Mobile Tel: +256 (0)702 864 964
Work Tel: +256 776 864 965
Skype: jimmyjaymes1
Alt email: jtinkamanyire samira@mgh.harvard.edu@mustresearch.org
http://www.mghcgh.org/
Website: www.ghc.org http://www.mghcgh.org/

Hi James,

Unfortunately date questions are a bit tricky because if a date question is
displayed to the user then the default value will be today's date, unless a
default value has been set, so it will never be blank. For this reason, if
you want to create a display condition around a date question, it can
sometimes be better to but a yes/no question before a date question (such
as "do you want to enter a visit date?") and use that as the basis for your
logic.

Jeremy

··· On Wed, Aug 31, 2016 at 8:13 PM, James Tinkamanyire < jamestinkamanyire@gmail.com> wrote:

Thanks, William. Can I use this for a date field as well?

On Thu, Sep 1, 2016 at 3:11 AM, William Pride wpride@dimagi.com wrote:

James,

Yes, that will work.

Cheers,
Will

On Wed, Aug 31, 2016 at 8:05 PM, James Tinkamanyire < jamestinkamanyire@gmail.com> wrote:

Hello,

I am trying to write a display condition and would like to include an
empty string in the condition. Are single quotes okay? For example if I
wrote display logic as *display question if /data/visit_date = ''. *Would
this work?

Thanks,
James

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/commcare-users/1Evid6b1tSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

*James Tinkamanyire *| Data Manager

Measuring Early Treatment Adherence - META ProjectGlobal Health
Collaborative - MUST - Uganda

P.O. Box 1397, Mbarara.

BSc Computer EngineeringMBARARA UNIVERSITY OF SCIENCE & TECHNOLOGYP.O.
Box 1410, Mbarara, Uganda.

Mobile Tel: +256 (0)702 864 964
Work Tel: +256 776 864 965
Skype: jimmyjaymes1
Alt email: jtinkamanyire samira@mgh.harvard.edu@mustresearch.org
http://www.mghcgh.org/
Website: www.ghc.org http://www.mghcgh.org/

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Jeremy Wacksman
Dimagi http://www.dimagi.com, Inc.

Thanks, Jeremy. This is very helpful.

Hi James,

Unfortunately date questions are a bit tricky because if a date question is
displayed to the user then the default value will be today's date, unless a
default value has been set, so it will never be blank. For this reason, if
you want to create a display condition around a date question, it can
sometimes be better to but a yes/no question before a date question (such
as "do you want to enter a visit date?") and use that as the basis for your
logic.

Jeremy

··· Sent from a mobile device On Sep 10, 2016 5:58 PM, "Jeremy W." wrote:

On Wed, Aug 31, 2016 at 8:13 PM, James Tinkamanyire < jamestinkamanyire@gmail.com> wrote:

Thanks, William. Can I use this for a date field as well?

On Thu, Sep 1, 2016 at 3:11 AM, William Pride wpride@dimagi.com wrote:

James,

Yes, that will work.

Cheers,
Will

On Wed, Aug 31, 2016 at 8:05 PM, James Tinkamanyire < jamestinkamanyire@gmail.com> wrote:

Hello,

I am trying to write a display condition and would like to include an
empty string in the condition. Are single quotes okay? For example if I
wrote display logic as *display question if /data/visit_date = ''. *Would
this work?

Thanks,
James

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/commcare-users/1Evid6b1tSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

*James Tinkamanyire *| Data Manager

Measuring Early Treatment Adherence - META ProjectGlobal Health
Collaborative - MUST - Uganda

P.O. Box 1397, Mbarara.

BSc Computer EngineeringMBARARA UNIVERSITY OF SCIENCE & TECHNOLOGYP.O.
Box 1410, Mbarara, Uganda.

Mobile Tel: +256 (0)702 864 964
Work Tel: +256 776 864 965
Skype: jimmyjaymes1
Alt email: jtinkamanyire samira@mgh.harvard.edu@mustresearch.org
http://www.mghcgh.org/
Website: www.ghc.org http://www.mghcgh.org/

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Jeremy Wacksman
Dimagi http://www.dimagi.com, Inc.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/commcare-users/1Evid6b1tSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hello

What if it is;

  1. a Hidden Value
  2. a Decimal

Thank you
A.

Hi!

You can read about these question types on this help site page.

Please feel free to ask if you have any additional questions about them!

-Clayton

It is still not clear for me (as I can't find it in the page you mention), if for decimals and hidden values I can include an empty string in the condition using single quotes.
e.g. #form/variables/weightAdult=''

Hi,

You can definitely represent the "empty" condition with single quotes.

Whether a decimal question is 'equal' to empty string can depend on a few different elements, though.

An unanswered decimal question will be equal to ''. A decimal question that is equal to 0 (or 0.0) won't be equal to 0.0, so if the question is required it will only be equal to 'blank' when it is unanswered.

-Clayton