Xpath Evaluation: instance referenced error

Hi Team;
I am Tired now after much debugging I tried my best but did not figure out what I was doing wrong it’s giving me errors repeatedly. Please find below the error details along with the screenshot.
because of being a new user, I can’t upload attachments.

Xpath Evaluation: instance referenced by instance (reg_ben2)/root/item/ProvinceName does not exist.

I’m trying to pick values from the sheet named " reg_ben2" and I have this column (ProvinceName ) but it keeps popping up the error on my mobile device.

could anybody help me what am I doing wrong?

Hi @jibran and welcome to the community.

It’s unfortunate you’re not able to attach files yet but this documentation might help you with this lookup values function here - XLSForm Docs

On first glance it looks like you’ve left out single quotation marks to make it 'reg_ben2'

Secondly, you might also need to specify the filter expression in this case. This syntax from the shared docs should be able to get you going

instance('list_name')/root/item[filter expression]/desired_property

So let’s assume you want to pick a province based on the country that means your syntax will look like so:

`instance(‘reg_ben2’)/root/item[filter expression]/desired_property

Additionally, if this sheet is dynamic and linked to another Kobo Form you can check out this article - Dynamic Data Attachments — KoboToolbox documentation

1 Like