Pre-populating a lookup table that sets Owner ID?

Hi,

I am using the Assigning Cases to One of Multiple Locations functionality, so I have a lookup table that populates with the organizations I have set up in my registration form. I was going to copy that table in a follow up form so that a user can reassign a case from within the mobile app. My questions are:

  1. I haven’t found any documentation on using this functionality in this way, so was just wondering if there are any red flags about doing this.
  2. If there are no red flags, is it possible to pre-populate this question in the follow up form with the owner_id from the registration form? I have the answer saved as a case property, and put it in the default value field but it doesn’t pre-populate.

Thanks!

Hi Natalie,

I can confirm that there are no red flags about doing re-assignment in a
form, or with populating the other lookup table using the owner id, as the
keys for the lookup table will be coded with the same GUID as the owner ID
of the case.

Unfortunately, what you’re seeing is a limitation of the "Easy References"
in our form builder, which simplify the way that case properties are
referred to when building the app.

In order to reference the owner ID of the case selected, you’ll need to
instead provide an explicit reference rather than an easy reference. I
believe that you should be able to refer to the owner of the case with this
snippet:

instance(‘casedb’)/casedb/case[@case_id =
instance(‘commcaresession’)/session/data/case_id]/@owner_id

which will allow you to pre-populate the lookup table question.

Please let me know if that doesn’t address the issue!

-Clayton