Creating two related cases inside a Repeat Group using Save to Case

Hello,

I am using ‘Save to Case’ under a ‘Repeat Group’ to create a case. I was able to create the case, but I have a problem when I try to create a relationship (host-extension) with another case created in the same Repeat Group. As shown on the attached screenshot, I want to create delegation and illness cases and I want to make the illness case a Host to the delegation case. I tried specifying the illness_id as an index to the delegation case, but the illness_id can have a value when the repeat group is completed. So, it returns an empty ID, and the relationship won’t be created.

image

I would appreciate any help.

Mariawit S.Y

Hi Mariawit,

I believe that in the question create_new_illness_case the case ID is being generated by a uuid() function. So, in order to reference the generated ID in create_new_delegation_case for the ‘current’ iteration of the repeat group, it’s necessary to include the full path of the question + reference to the case ID according to the internal structure of a save to case question, it would be something like /data/ftat_case_investigation/enforce_repeat_num/create_new_illness_case/create_new_illness_case/case/@case_id (assuming the repeat group question ID is ftat_case_investigation).

Cheers

Thanks Ahmad.

That solved the problem.

Mariawit