Updating Case Property Causes Value to Go Blank in Case List

Hey all,

I’ve been struggling to make sense of this function of case-sharing and
would appreciate any help.

I am trying to develop an app that would allow me to provide each case with
a credit balance - lets call this variable credit_balance (determined with
a hidden value in the registration form). Then, in a follow-up form, we
could adjust the available balance using another hidden value. So in the
follow-up form, we’d have the balance case property (credit_balance) from
the registration form being updated and replaced on the case with a value
from the follow-up form. I’ve attempted to do this by calling the Question
ID the same in the two forms, and saving both questions to case properties.
At the end of the follow-up form, I have a label that calls up the new
credit_balance value to assure the task worked.

Each time I do this, however, the credit balance either does not update, or
it disappears entirely - from the label and the case list. Any idea what I
may be doing wrong here?

Thanks,
Kaan

Hi Kaan,

what have you set the calculate condition to in the credit_balance property
in the registration form? If you have left the calculate condition of that
field as a null value (empty) then if may cause the property to disappear
from the case list. this is because a null value cannot be used in
calculation with numeric values.

Top carry out the calculation that you want i would suggest the following;

In your registration form set the credit_balance property’s calculate
condition to 0 (or what ever starting credit balance you want)
then in your follow up form you will have a question to enter the new
credit balance (lets call it enter_new_credit). Additionally create a
hidden value, lets call it new_credit_balance and set the calculate
condition to; case/credit_balace + form/enter_new_credit. then in the case
management of the follow-up form load the new_credit_balance into the
case’s credit_balance.

Kindly,
Ameera

··· On Monday, 4 September 2017 19:20:05 UTC+2, Kaan Yarar wrote: > > Hey all, > > I've been struggling to make sense of this function of case-sharing and > would appreciate any help. > > I am trying to develop an app that would allow me to provide each *case* with > a credit balance - lets call this variable credit_balance (determined with > a hidden value in the registration form). Then, in a follow-up form, we > could adjust the available balance using another hidden value. So in the > follow-up form, we'd have the balance case property (credit_balance) from > the registration form being updated and replaced on the case with a value > from the follow-up form. I've attempted to do this by calling the Question > ID the same in the two forms, and saving both questions to case properties. > At the end of the follow-up form, I have a label that calls up the new > credit_balance value to assure the task worked. > > Each time I do this, however, the credit balance either does not update, > or it disappears entirely - from the label and the case list. Any idea what > I may be doing wrong here? > > Thanks, > Kaan >

Hi Ameera,

Thanks for your advice.

I have been setting the starting balance as a value in the registration
form. The individual is assigned a credit balance in this first
registration phase. This part is working fine. The individual is given the
right value and the case list loads the correct value of this property.

The problem comes when updating this property in follow up form. I would
like to add or subtract to the balance in that form using a few hidden
value calculations, and check if it worked by using a label at the end of
the form.

To update and overwrite a case property value, is the only necessary step
to call a question ID in the follow-up form the same as the case property
name?

Thanks again,
Kaan

··· On Sep 5, 2017 1:09 AM, "Ameera Hamid" wrote:

Hi Kaan,

what have you set the calculate condition to in the credit_balance
property in the registration form? If you have left the calculate
condition of that field as a null value (empty) then if may cause the
property to disappear from the case list. this is because a null value
cannot be used in calculation with numeric values.

Top carry out the calculation that you want i would suggest the following;

In your registration form set the credit_balance property’s calculate
condition to 0 (or what ever starting credit balance you want)
then in your follow up form you will have a question to enter the new
credit balance (lets call it enter_new_credit). Additionally create a
hidden value, lets call it new_credit_balance and set the calculate
condition to; case/credit_balace + form/enter_new_credit. then in the case
management of the follow-up form load the new_credit_balance into the
case’s credit_balance.

Kindly,
Ameera

On Monday, 4 September 2017 19:20:05 UTC+2, Kaan Yarar wrote:

Hey all,

I’ve been struggling to make sense of this function of case-sharing and
would appreciate any help.

I am trying to develop an app that would allow me to provide each case with
a credit balance - lets call this variable credit_balance (determined with
a hidden value in the registration form). Then, in a follow-up form, we
could adjust the available balance using another hidden value. So in the
follow-up form, we’d have the balance case property (credit_balance) from
the registration form being updated and replaced on the case with a value
from the follow-up form. I’ve attempted to do this by calling the Question
ID the same in the two forms, and saving both questions to case properties.
At the end of the follow-up form, I have a label that calls up the new
credit_balance value to assure the task worked.

Each time I do this, however, the credit balance either does not update,
or it disappears entirely - from the label and the case list. Any idea what
I may be doing wrong here?

Thanks,
Kaan


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