User case management using the new easy reference system

Hi everybody,

I'm trying to use the user case management to store the number of case
created by a worker.
So I'm storing the number in a user case property, and loading it in the
form to increment it (+1) and saving it back.

The process should be fine, but doesn't work... As user case manageent is
using the old way to reference properties, I was thinking this could be
related.

Did I miss something in the way ? Am I imagining things ?

Thanks in advance,

Michel

Hi,

Any hints on this ?

Thanks a lot !

··· Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a écrit : > > Hi everybody, > > I'm trying to use the user case management to store the number of case > created by a worker. > So I'm storing the number in a user case property, and loading it in the > form to increment it (+1) and saving it back. > > The process should be fine, but doesn't work... As user case management is > using the old way to reference properties, I was thinking this could be > related. > > Did I miss something in the way ? Am I imagining things ? > > Thanks in advance, > > Michel >

Michel,

Your outline sounds like it should work - what behavior are you seeing?
Could you send screenshots of your configuration?

Thanks,
Will

··· On Thu, Nov 17, 2016 at 7:38 PM Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Hi,

Any hints on this ?

Thanks a lot !

Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a
écrit :

Hi everybody,

I'm trying to use the user case management to store the number of case
created by a worker.
So I'm storing the number in a user case property, and loading it in the
form to increment it (+1) and saving it back.

The process should be fine, but doesn't work... As user case management is
using the old way to reference properties, I was thinking this could be
related.

Did I miss something in the way ? Am I imagining things ?

Thanks in advance,

Michel

--
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.

Hi William,

I'm using user case management in the project
space Log In :: CommCare HQ - CommCare HQ

Here are some screenshots :
The user case management panel :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/ydce5fpu.png
The hidden values calculating the counters :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/-br18b_7.png
The user case that should be updated :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/y03f7k6d.png
The change to the case based on a test form :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/c-nmens2.png

Actually, the behavior I'm witnessing is just nothing. It seems like the
data are not saved to the case.

Please let me know if I did something wrong...

Thanks in advance,

Michel

··· Le vendredi 18 novembre 2016 02:40:57 UTC+1, William Pride a écrit : > > Michel, > > Your outline sounds like it should work - what behavior are you seeing? > Could you send screenshots of your configuration? > > Thanks, > Will > On Thu, Nov 17, 2016 at 7:38 PM Michel Akkaoui - de Sousa < akka...@gmail.com > wrote: > >> Hi, >> >> Any hints on this ? >> >> Thanks a lot ! >> >> >> Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a >> écrit : >> >>> Hi everybody, >>> >>> I'm trying to use the user case management to store the number of case >>> created by a worker. >>> So I'm storing the number in a user case property, and loading it in the >>> form to increment it (+1) and saving it back. >>> >>> The process should be fine, but doesn't work... As user case management >>> is using the old way to reference properties, I was thinking this could be >>> related. >>> >> >>> Did I miss something in the way ? Am I imagining things ? >>> >>> Thanks in advance, >>> >>> Michel >>> >> -- >> 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-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> >

Michel,

I would confirm in your test form submissions that the hidden values
intended to be saved to the User Case are set. If the display condition of
these values is false or the calculation returns null then the properties
will not be updated. Glancing through some of your form submission these
values don't seem to be set.

Cheers,
Will

··· On Tue, Nov 22, 2016 at 5:34 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Hi William,

I'm using user case management in the project space
Log In :: CommCare HQ - CommCare HQ

Here are some screenshots :
The user case management panel :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/ydce5fpu.png
The hidden values calculating the counters :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/-br18b_7.png
The user case that should be updated :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/y03f7k6d.png
The change to the case based on a test form :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/c-nmens2.png

Actually, the behavior I'm witnessing is just nothing. It seems like the
data are not saved to the case.

Please let me know if I did something wrong...

Thanks in advance,

Michel

Le vendredi 18 novembre 2016 02:40:57 UTC+1, William Pride a écrit :

Michel,

Your outline sounds like it should work - what behavior are you seeing?
Could you send screenshots of your configuration?

Thanks,
Will
On Thu, Nov 17, 2016 at 7:38 PM Michel Akkaoui - de Sousa < akka...@gmail.com> wrote:

Hi,

Any hints on this ?

Thanks a lot !

Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a
écrit :

Hi everybody,

I'm trying to use the user case management to store the number of case
created by a worker.
So I'm storing the number in a user case property, and loading it in
the form to increment it (+1) and saving it back.

The process should be fine, but doesn't work... As user case management
is using the old way to reference properties, I was thinking this could be
related.

Did I miss something in the way ? Am I imagining things ?

Thanks in advance,

Michel

--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.

Hi William,

Thanks again.

But how could that be if the display condition is blank and the calculation
can't be null (x+1) ?!?
For instance
: https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/eelaq6zs.png

··· Le mercredi 23 novembre 2016 16:13:07 UTC+1, William Pride a écrit : > > Michel, > > I would confirm in your test form submissions that the hidden values > intended to be saved to the User Case are set. If the display condition of > these values is false or the calculation returns null then the properties > will not be updated. Glancing through some of your form submission these > values don't seem to be set. > > Cheers, > Will > > On Tue, Nov 22, 2016 at 5:34 PM, Michel Akkaoui - de Sousa < akka...@gmail.com > wrote: > >> Hi William, >> >> I'm using user case management in the project space >> https://www.commcarehq.org/a/mobisan-service-3 >> >> Here are some screenshots : >> The user case management panel : >> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/ydce5fpu.png >> The hidden values calculating the counters : >> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/-br18b_7.png >> The user case that should be updated : >> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/y03f7k6d.png >> The change to the case based on a test form : >> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/c-nmens2.png >> >> Actually, the behavior I'm witnessing is just nothing. It seems like the >> data are not saved to the case. >> >> Please let me know if I did something wrong... >> >> Thanks in advance, >> >> Michel >> >> >> Le vendredi 18 novembre 2016 02:40:57 UTC+1, William Pride a écrit : >>> >>> Michel, >>> >>> Your outline sounds like it should work - what behavior are you seeing? >>> Could you send screenshots of your configuration? >>> >>> Thanks, >>> Will >>> On Thu, Nov 17, 2016 at 7:38 PM Michel Akkaoui - de Sousa < akka...@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> Any hints on this ? >>>> >>>> Thanks a lot ! >>>> >>>> >>>> Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a >>>> écrit : >>>> >>>>> Hi everybody, >>>>> >>>>> I'm trying to use the user case management to store the number of case >>>>> created by a worker. >>>>> So I'm storing the number in a user case property, and loading it in >>>>> the form to increment it (+1) and saving it back. >>>>> >>>>> The process should be fine, but doesn't work... As user case >>>>> management is using the old way to reference properties, I was thinking >>>>> this could be related. >>>>> >>>> >>>>> Did I miss something in the way ? Am I imagining things ? >>>>> >>>>> Thanks in advance, >>>>> >>>>> Michel >>>>> >>>> -- >>>> 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-user...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> 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-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >

Michel,

That calculation actually will be null if 'x' refers to a question that
isn't set, as null + 1 = null in XPath world (instead of null being coerced
to '0' as you might expect). Often in calculations like this people will
use the coalesce() function so that they can get a '0' default if the value
hasn't been set yet, IE:

updated_value = coalesce(old_value, '0')

Cheers,
Will

··· On Wed, Nov 23, 2016 at 10:28 AM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Hi William,

Thanks again.

But how could that be if the display condition is blank and the
calculation can't be null (x+1) ?!?
For instance : https://dl.dropboxusercontent.com/spa/
enxbvrwkrbi5b9e/eelaq6zs.png

Le mercredi 23 novembre 2016 16:13:07 UTC+1, William Pride a écrit :

Michel,

I would confirm in your test form submissions that the hidden values
intended to be saved to the User Case are set. If the display condition of
these values is false or the calculation returns null then the properties
will not be updated. Glancing through some of your form submission these
values don't seem to be set.

Cheers,
Will

On Tue, Nov 22, 2016 at 5:34 PM, Michel Akkaoui - de Sousa < akka...@gmail.com> wrote:

Hi William,

I'm using user case management in the project space
Log In :: CommCare HQ - CommCare HQ

Here are some screenshots :
The user case management panel :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/ydce5fpu.png
The hidden values calculating the counters :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/-br18b_7.png
The user case that should be updated :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/y03f7k6d.png
The change to the case based on a test form :
https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/c-nmens2.png

Actually, the behavior I'm witnessing is just nothing. It seems like the
data are not saved to the case.

Please let me know if I did something wrong...

Thanks in advance,

Michel

Le vendredi 18 novembre 2016 02:40:57 UTC+1, William Pride a écrit :

Michel,

Your outline sounds like it should work - what behavior are you seeing?
Could you send screenshots of your configuration?

Thanks,
Will
On Thu, Nov 17, 2016 at 7:38 PM Michel Akkaoui - de Sousa < akka...@gmail.com> wrote:

Hi,

Any hints on this ?

Thanks a lot !

Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a écrit :

Hi everybody,

I'm trying to use the user case management to store the number of
case created by a worker.
So I'm storing the number in a user case property, and loading it in
the form to increment it (+1) and saving it back.

The process should be fine, but doesn't work... As user case
management is using the old way to reference properties, I was thinking
this could be related.

Did I miss something in the way ? Am I imagining things ?

Thanks in advance,

Michel

--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.

Ok thanks that was the missing part that I didn't know about... XPasth is a
strange world...

Thanks again for your time !

Michel

··· Le mercredi 23 novembre 2016 18:04:09 UTC+1, William Pride a écrit : > > Michel, > > That calculation actually will be null if 'x' refers to a question that > isn't set, as null + 1 = null in XPath world (instead of null being coerced > to '0' as you might expect). Often in calculations like this people will > use the coalesce() function so that they can get a '0' default if the value > hasn't been set yet, IE: > > updated_value = coalesce(old_value, '0') > > Cheers, > Will > > On Wed, Nov 23, 2016 at 10:28 AM, Michel Akkaoui - de Sousa < akka...@gmail.com > wrote: > >> Hi William, >> >> Thanks again. >> >> But how could that be if the display condition is blank and the >> calculation can't be null (x+1) ?!? >> For instance : >> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/eelaq6zs.png >> >> Le mercredi 23 novembre 2016 16:13:07 UTC+1, William Pride a écrit : >>> >>> Michel, >>> >>> I would confirm in your test form submissions that the hidden values >>> intended to be saved to the User Case are set. If the display condition of >>> these values is false or the calculation returns null then the properties >>> will not be updated. Glancing through some of your form submission these >>> values don't seem to be set. >>> >>> Cheers, >>> Will >>> >>> On Tue, Nov 22, 2016 at 5:34 PM, Michel Akkaoui - de Sousa < akka...@gmail.com> wrote: >>> >>>> Hi William, >>>> >>>> I'm using user case management in the project space >>>> https://www.commcarehq.org/a/mobisan-service-3 >>>> >>>> Here are some screenshots : >>>> The user case management panel : >>>> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/ydce5fpu.png >>>> The hidden values calculating the counters : >>>> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/-br18b_7.png >>>> The user case that should be updated : >>>> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/y03f7k6d.png >>>> The change to the case based on a test form : >>>> https://dl.dropboxusercontent.com/spa/enxbvrwkrbi5b9e/c-nmens2.png >>>> >>>> Actually, the behavior I'm witnessing is just nothing. It seems like >>>> the data are not saved to the case. >>>> >>>> Please let me know if I did something wrong... >>>> >>>> Thanks in advance, >>>> >>>> Michel >>>> >>>> >>>> Le vendredi 18 novembre 2016 02:40:57 UTC+1, William Pride a écrit : >>>>> >>>>> Michel, >>>>> >>>>> Your outline sounds like it should work - what behavior are you >>>>> seeing? Could you send screenshots of your configuration? >>>>> >>>>> Thanks, >>>>> Will >>>>> On Thu, Nov 17, 2016 at 7:38 PM Michel Akkaoui - de Sousa < akka...@gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Any hints on this ? >>>>>> >>>>>> Thanks a lot ! >>>>>> >>>>>> >>>>>> Le mercredi 26 octobre 2016 23:30:54 UTC+2, Michel Akkaoui - de Sousa a écrit : >>>>>> >>>>>>> Hi everybody, >>>>>>> >>>>>>> I'm trying to use the user case management to store the number of >>>>>>> case created by a worker. >>>>>>> So I'm storing the number in a user case property, and loading it in >>>>>>> the form to increment it (+1) and saving it back. >>>>>>> >>>>>>> The process should be fine, but doesn't work... As user case >>>>>>> management is using the old way to reference properties, I was thinking >>>>>>> this could be related. >>>>>>> >>>>>> >>>>>>> Did I miss something in the way ? Am I imagining things ? >>>>>>> >>>>>>> Thanks in advance, >>>>>>> >>>>>>> Michel >>>>>>> >>>>>> -- >>>>>> 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-user...@googlegroups.com. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> -- >>>> 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-user...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> 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-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >