CommCare Child Cases

Hello!

When I am submitting child cases to CommCare, the link to the parent case is supposed to look something like this:

<n0:index>
     <n0:parent case_type="Household">15fdc4f7-4ccc-488e-98e3-3bebc2909f26</n0:parent>
</n0:index>

The closest I have gotten to emulating this using the adaptor is the following syntax:

Inline image 1

This syntax results in the following xml:

<n0:index>
     <n0:parent case_type="Household">
	    <function>9eb64cab-edd7-4447-87e9-64178e9b9faf</function>
     </n0:parent>
</n0:index>

I haven’t been able to find a way to get rid of that tag so that the code is just inside the parent tag. Have you run into this before?

Hey Will,

I can’t see your image, but check out lines 44-51 in this job. “@” takes an object and sets the attributes. “#” takes a value and sets the value for that tag.

Under the hood, we’re using a node module called “js2xmlparser” which does exactly what it sounds like! Check out the basic usage examples here: https://github.com/michaelkourlas/node-js2xmlparser#examples

Please let me know if this solves your problem.

Taylor

Yup! ‘#’ was what I was looking for. Thanks!