Update form from the report

Hi,

I have a custom report which loads list of forms. Additionally I have to
provide functionality similar to “Reassign Cases” - main goal is to
select multiple rows and execute an action on selected forms. In my
report this action is setting value of particular field (called
"status") in selected forms. So I’d like to ask if there is an easy way
to do it like it is for Case Reassignment in case_management.js file? I
thought about using CloudCare functions to do it - but some of the forms
can’t be filled by web user due to case sharing - is there a way around
this?

Also I thought about adding this field to the case - but this is not a
good way since I need to filter results by this field and I can’t do
such filter in elastic search query which loads forms, can I?

Best regards
Pawel

Hi Pawel

Its not usually a good idea to change values in a form submission, we
generally treat them as read only data. I would definitely advocate for
using a case property. Cases are indexed in elastic search but there are
only a limited set of project spaces that are fully indexed (meaning all
their case properties).

Which report are you working on?

··· On 5 March 2014 16:49, Paweł Reise wrote:

Hi,

I have a custom report which loads list of forms. Additionally I have to
provide functionality similar to “Reassign Cases” - main goal is to select
multiple rows and execute an action on selected forms. In my report this
action is setting value of particular field (called “status”) in selected
forms. So I’d like to ask if there is an easy way to do it like it is for
Case Reassignment in case_management.js file? I thought about using
CloudCare functions to do it - but some of the forms can’t be filled by web
user due to case sharing - is there a way around this?

Also I thought about adding this field to the case - but this is not a
good way since I need to filter results by this field and I can’t do such
filter in elastic search query which loads forms, can I?

Best regards
Pawel

— You received this message because you are subscribed to the Google
Groups “CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Simon Kelly
Senior Engineer | Dimagi South Africa

Hi Simon,

thanks for the response. I’m attaching mock-up of the report I’m working
on. This is basically a list of clients that are eligible for payment
based on defined business rules - however client can fulfill more than
one business rule so we can have multiple rows / payments per client -
that’s why we made it as a form report. Use case is that user can select
multiple rows from the first report (mCCT Project Review page) and they
are moved to the second one (mCCT client approval page). So we need to
check the status of the row/payment in order to put it on the
appropriate report and be able to change this status for the selected
rows. Do you have an idea what other approach can we use to make it working?

Best regards
Pawel

PROJECT DOCUMENT - m4change Portal_ver4.35-36.pdf (562 KB)

··· On 03/05/2014 04:28 PM, Simon Kelly wrote: > Hi Pawel > > Its not usually a good idea to change values in a form submission, we > generally treat them as read only data. I would definitely advocate > for using a case property. Cases are indexed in elastic search but > there are only a limited set of project spaces that are fully indexed > (meaning all their case properties). > > Which report are you working on? > > > On 5 March 2014 16:49, Paweł Reise <preise@soldevelo.com > wrote: > > Hi, > > I have a custom report which loads list of forms. Additionally I > have to provide functionality similar to "Reassign Cases" - main > goal is to select multiple rows and execute an action on selected > forms. In my report this action is setting value of particular > field (called "status") in selected forms. So I'd like to ask if > there is an easy way to do it like it is for Case Reassignment in > case_management.js file? I thought about using CloudCare functions > to do it - but some of the forms can't be filled by web user due > to case sharing - is there a way around this? > > Also I thought about adding this field to the case - but this is > not a good way since I need to filter results by this field and I > can't do such filter in elastic search query which loads forms, can I? > > Best regards > Pawel > > -- > > --- You received this message because you are subscribed to the > Google Groups "CommCare Developers" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to commcare-developers+unsubscribe@googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > Simon Kelly > Senior Engineer | Dimagi South Africa > -- > > --- > You received this message because you are subscribed to the Google > Groups "CommCare Developers" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to commcare-developers+unsubscribe@googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out.

Hi Pawel,

Sorry about the delayed response. I would try to separate the logic that
displays the report from the logic that updates the data. Here are some
guiding principles I think you should use to accommodate your workflow:

  1. It’s better to use cases to track data that can change, though you can
    use forms if it makes a workflow a lot easier.
  2. Never update cases or forms directly in the database. You can use
    submit_case_blocks, or submit_form_locally to do that. To override an
    existing form, you can submit new XML with the same ID, which should
    deprecate the form.
  3. case_management.js is generally viewed as a mistake, since it requires
    additional submissions to go from the client to the server. It’s better to
    just post to a custom URL and do the submissions behind the scenes on the
    backend.

Feel free to reach out if you have additional questions.

Cory

··· On Wed, Mar 5, 2014 at 11:04 AM, Paweł Reise wrote:

Hi Simon,

thanks for the response. I’m attaching mock-up of the report I’m working
on. This is basically a list of clients that are eligible for payment based
on defined business rules - however client can fulfill more than one
business rule so we can have multiple rows / payments per client - that’s
why we made it as a form report. Use case is that user can select multiple
rows from the first report (mCCT Project Review page) and they are moved to
the second one (mCCT client approval page). So we need to check the status
of the row/payment in order to put it on the appropriate report and be able
to change this status for the selected rows. Do you have an idea what other
approach can we use to make it working?

Best regards
Pawel

On 03/05/2014 04:28 PM, Simon Kelly wrote:

Hi Pawel

Its not usually a good idea to change values in a form submission, we
generally treat them as read only data. I would definitely advocate for
using a case property. Cases are indexed in elastic search but there are
only a limited set of project spaces that are fully indexed (meaning all
their case properties).

Which report are you working on?

On 5 March 2014 16:49, Paweł Reise preise@soldevelo.com wrote:

Hi,

I have a custom report which loads list of forms. Additionally I have to
provide functionality similar to “Reassign Cases” - main goal is to select
multiple rows and execute an action on selected forms. In my report this
action is setting value of particular field (called “status”) in selected
forms. So I’d like to ask if there is an easy way to do it like it is for
Case Reassignment in case_management.js file? I thought about using
CloudCare functions to do it - but some of the forms can’t be filled by web
user due to case sharing - is there a way around this?

Also I thought about adding this field to the case - but this is not a
good way since I need to filter results by this field and I can’t do such
filter in elastic search query which loads forms, can I?

Best regards
Pawel

— You received this message because you are subscribed to the Google
Groups “CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Simon Kelly
Senior Engineer | Dimagi South Africa


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


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