Pre-loading previous answer to a case field

Hi everyone. I'm having some problems trying to get a case field that is
updated a number of times to show the value which was entered the previous
time.

The example is of a loan case. The loan can either be marked as fully
collected and closed or can have a value entered for how much has been
collected so far. As multiple collections would be made I would like the
'Amount Collected' to show the value entered on the previous case updates.

What Im trying to do is probably not the most elegant approach to take. So
far Ive tried to preload its own value but this hasnt worked for me so far.

Hi

The usual approach to solving this is to create a hidden value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Value+Calculations+Tutorial
in
the form. You can then load the current value of the case property into the
hidden value and use it to display the value to the user as described here:
https://help.commcarehq.org/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output

You would update the case property as usual from the question that asks the
user "how much has been collected in total" or you could ask the user "how
much they collected this time" and then have another hidden value which
calculates the total amount collected and save that value to the case
property.

··· On 26 June 2014 08:00, wrote:

Hi everyone. I'm having some problems trying to get a case field that is
updated a number of times to show the value which was entered the previous
time.

The example is of a loan case. The loan can either be marked as fully
collected and closed or can have a value entered for how much has been
collected so far. As multiple collections would be made I would like the
'Amount Collected' to show the value entered on the previous case updates.

What Im trying to do is probably not the most elegant approach to take. So
far Ive tried to preload its own value but this hasnt worked for me so far.

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

--
Simon Kelly
Senior Engineer | Dimagi South Africa

Thanks Simon

··· On Thursday, June 26, 2014 4:09:17 PM UTC+6:30, skelly wrote: > > Hi > > The usual approach to solving this is to create a hidden value > in > the form. You can then load the current value of the case property into the > hidden value and use it to display the value to the user as described here: > https://help.commcarehq.org/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output > > You would update the case property as usual from the question that asks > the user "how much has been collected in total" or you could ask the user > "how much they collected this time" and then have another hidden value > which calculates the total amount collected and save that value to the case > property. > > > > > On 26 June 2014 08:00, <bmcd...@proximitydesigns.org > wrote: > >> Hi everyone. I'm having some problems trying to get a case field that is >> updated a number of times to show the value which was entered the previous >> time. >> >> The example is of a loan case. The loan can either be marked as fully >> collected and closed or can have a value entered for how much has been >> collected so far. As multiple collections would be made I would like the >> 'Amount Collected' to show the value entered on the previous case updates. >> >> What Im trying to do is probably not the most elegant approach to take. >> So far Ive tried to preload its own value but this hasnt worked for me so >> far. >> >> -- >> 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. >> > > > > -- > Simon Kelly > Senior Engineer | Dimagi South Africa >

Hi Simon,
As far as I can see this cant work. It only works if the label to be placed
after the input that sets the hidden value.
If I update a case a second time it is not able to show a label containing
the value entered on a previous update.

It looks like a case update cant store a hidden value that can be used in
subsequent updates.

··· On Thursday, June 26, 2014 4:09:17 PM UTC+6:30, skelly wrote: > > Hi > > The usual approach to solving this is to create a hidden value > in > the form. You can then load the current value of the case property into the > hidden value and use it to display the value to the user as described here: > https://help.commcarehq.org/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output > > You would update the case property as usual from the question that asks > the user "how much has been collected in total" or you could ask the user > "how much they collected this time" and then have another hidden value > which calculates the total amount collected and save that value to the case > property. > > > > > On 26 June 2014 08:00, <bmcd...@proximitydesigns.org > wrote: > >> Hi everyone. I'm having some problems trying to get a case field that is >> updated a number of times to show the value which was entered the previous >> time. >> >> The example is of a loan case. The loan can either be marked as fully >> collected and closed or can have a value entered for how much has been >> collected so far. As multiple collections would be made I would like the >> 'Amount Collected' to show the value entered on the previous case updates. >> >> What Im trying to do is probably not the most elegant approach to take. >> So far Ive tried to preload its own value but this hasnt worked for me so >> far. >> >> -- >> 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. >> > > > > -- > Simon Kelly > Senior Engineer | Dimagi South Africa >

Hi Simon,
I cant get a value to show using this method. All that is appearing is
either ${0} or ${1}.
Ive checked my syntax a number of times but it still doesn't display a
value.
Could it possibly be related to the error I have been experiencing where
${0} is appearing in places it shouldnt?

··· On Friday, June 27, 2014 11:48:55 AM UTC+6:30, bmcd...@proximitydesigns.org wrote: > > Thanks Simon > > On Thursday, June 26, 2014 4:09:17 PM UTC+6:30, skelly wrote: >> >> Hi >> >> The usual approach to solving this is to create a hidden value >> in >> the form. You can then load the current value of the case property into the >> hidden value and use it to display the value to the user as described here: >> https://help.commcarehq.org/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output >> >> You would update the case property as usual from the question that asks >> the user "how much has been collected in total" or you could ask the user >> "how much they collected this time" and then have another hidden value >> which calculates the total amount collected and save that value to the case >> property. >> >> >> >> >> On 26 June 2014 08:00, wrote: >> >>> Hi everyone. I'm having some problems trying to get a case field that is >>> updated a number of times to show the value which was entered the previous >>> time. >>> >>> The example is of a loan case. The loan can either be marked as fully >>> collected and closed or can have a value entered for how much has been >>> collected so far. As multiple collections would be made I would like the >>> 'Amount Collected' to show the value entered on the previous case updates. >>> >>> What Im trying to do is probably not the most elegant approach to take. >>> So far Ive tried to preload its own value but this hasnt worked for me so >>> far. >>> >>> -- >>> 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. >>> >> >> >> >> -- >> Simon Kelly >> Senior Engineer | Dimagi South Africa >> >

Hey,

This should definitely work. You need to configure the case management
section to load the right case property into the hidden value and also save
the answer to the question back to the same case property.

The workflow I just described in response to this thread
https://groups.google.com/forum/#!topic/commcare-users/Na0rHS379WE is
essentially the same problem (just with an added calculation step).

Cory

··· On Wed, Jul 9, 2014 at 4:57 PM, wrote:

Hi Simon,
As far as I can see this cant work. It only works if the label to be
placed after the input that sets the hidden value.
If I update a case a second time it is not able to show a label containing
the value entered on a previous update.

It looks like a case update cant store a hidden value that can be used in
subsequent updates.

On Thursday, June 26, 2014 4:09:17 PM UTC+6:30, skelly wrote:

Hi

The usual approach to solving this is to create a hidden value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Value+Calculations+Tutorial in
the form. You can then load the current value of the case property into the
hidden value and use it to display the value to the user as described here:
Home - CommCare Public - CommCare Public
Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output

You would update the case property as usual from the question that asks
the user "how much has been collected in total" or you could ask the user
"how much they collected this time" and then have another hidden value
which calculates the total amount collected and save that value to the case
property.

On 26 June 2014 08:00, bmcd...@proximitydesigns.org wrote:

Hi everyone. I'm having some problems trying to get a case field that is
updated a number of times to show the value which was entered the previous
time.

The example is of a loan case. The loan can either be marked as fully
collected and closed or can have a value entered for how much has been
collected so far. As multiple collections would be made I would like the
'Amount Collected' to show the value entered on the previous case updates.

What Im trying to do is probably not the most elegant approach to take.
So far Ive tried to preload its own value but this hasnt worked for me so
far.

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

--
Simon Kelly
Senior Engineer | Dimagi South Africa

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

I'm not sure where the ${0}'s are coming from but if you could report an
issue from the form where this is happening I can take a closer look to
diagnose the problem.

To report an issue use the 'Report an Issue' button at the bottom of the
screen on CommCare HQ.

Thanks
Simon

··· On 7 July 2014 12:45, wrote:

Hi Simon,
I cant get a value to show using this method. All that is appearing is
either ${0} or ${1}.
Ive checked my syntax a number of times but it still doesn't display a
value.
Could it possibly be related to the error I have been experiencing where
${0} is appearing in places it shouldnt?

On Friday, June 27, 2014 11:48:55 AM UTC+6:30, bmcd...@proximitydesigns.org wrote:

Thanks Simon

On Thursday, June 26, 2014 4:09:17 PM UTC+6:30, skelly wrote:

Hi

The usual approach to solving this is to create a hidden value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Value+Calculations+Tutorial in
the form. You can then load the current value of the case property into the
hidden value and use it to display the value to the user as described here:
Home - CommCare Public - CommCare Public
Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output

You would update the case property as usual from the question that asks
the user "how much has been collected in total" or you could ask the user
"how much they collected this time" and then have another hidden value
which calculates the total amount collected and save that value to the case
property.

On 26 June 2014 08:00, bmcd...@proximitydesigns.org wrote:

Hi everyone. I'm having some problems trying to get a case field that
is updated a number of times to show the value which was entered the
previous time.

The example is of a loan case. The loan can either be marked as fully
collected and closed or can have a value entered for how much has been
collected so far. As multiple collections would be made I would like the
'Amount Collected' to show the value entered on the previous case updates.

What Im trying to do is probably not the most elegant approach to take.
So far Ive tried to preload its own value but this hasnt worked for me so
far.

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

--
Simon Kelly
Senior Engineer | Dimagi South Africa

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

--
Simon Kelly
Senior Engineer | Dimagi South Africa