Case name referencing

Hi Evereyone,

I am trying to reference a case property in a follow up form but for some reason the question pulls the case id rather than the case name, how can i fix please?

image

I need the Group name to show up and not the ID, the same way the Department and Commune are showing up. The group detail is a separate case list though

The field i need to reference is this:

but rather its referencing the Case ID field in the form

Hi Jay, what expression are you using which evaluates to the case ID? Regardless, given the ID, you should be able to use this expression to obtain the case name:

instance('casedb')/casedb/case[@case_id = ID_EXPRESSION]/case_name

Hi @Ethan_Soergel,

I actually wasn’t using any expression since i have the group name saved as a case property so i only referened it in the form but then it’s picking up the case ID.

The current expression i am working on is this:

instance(‘casedb’)/casedb/case[@case_type = ‘benibiz_training_group_new’][Case_Id = #form/name_and_date_group/group]

But haven’t gotten it right yet.

Should it be:

instance(‘casedb’)/casedb/case[@case_type = ‘benibiz_training_group_new’][Case_Id = #form/name_and_date_group/group_name]

@Ethan_Soergel

Should the expression be placed within my hidden field?

I believe this should be the expression:

instance('casedb')/casedb/case[@case_type = 'benibiz_training_group_new'][@case_id = #form/name_and_date_group/group_name]

That is, I changed Case_Id to @case_id. Your screenshot above includes curly quotes and , which I replaced with simple quotes '. That can sometimes happen if you copy/pasted from a rich text editor like Word or email. The “Lexical error” in your screenshot refers to that issue.