error more or less = (which is not a valid question or value)
this is what my calculation field value looks like:
instance('locations-1')/locations/location[@id = #form/QListMain/site]/location_data/testid
However if I reference site_code using this calculation I get back the expected value and it seems to work (Notice the custom id label)
instance('locations-1')/locations/location[@id = #form/QListMain/site]/site_code
I can see that the location data is there, and the custom field testid.
So I came to the conclusion that the code:
instance('locations-1')/locations/location[@id = #form/QListMain/site]/location_data/testid
is actually correct then.
I randomly started fiddling and then came across setting a location for the mobile user.
I noticed that it wasnt set to anything and so I set it, and then logged back in.
As soon as I did that. It worked.
So if the mobile user has no location set this is the error that is thrown.
This is the result I got back by running the xpath evaluation: instance('locations-1')/locations/location
Cape Town Hospice
<site_code>cape_town_hospice</site_code>
<external_id/>