# Instance() is showing error in collect, you may need to use indexed-repeat()

**URL:** <https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620>\
**Category:** Support\
**Created:** [September 29, 2026, 8:09am UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620 "2026-09-29T08:09:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurrefws](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jurrefws](https://forum.getodk.org/u/jurrefws)\
**Post date:** [September 29, 2026, 8:09am UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/1 "2026-09-29T08:09:56Z")

</div>

**1. What is the issue? Please be detailed.**  
I am using instance formula to fetch values from a csv file , which is working fine in enketo but shows an error in collect , that the field is repeated you may need to use indexed-repeat().

**2. What steps can we take to reproduce this issue?**  
Form is attached , fetches value in enketo just fine but fails in collect.

**3. What have you tried to fix the issue?**  
Try using odk docs, [xlsform.org](http://xlsform.org) , odk forum previous threads, gemini as well.

**4. Upload any forms or screenshots you can share publicly below.**

[productsxml - productsxml.csv](https://forum.getodk.org/uploads/short-url/usGmtYGBsnFMwQqSBFmwJSXeexb.csv) (4.8 KB)

[ODK collect (5).xlsx](https://forum.getodk.org/uploads/short-url/g3kmaXV1ACW2JU3C5NE142YXodw.xlsx) (8.9 KB)

---

<div class="post-metadata">

**Author:** ![Stephen\_K\_ojwang](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/stephen_k_ojwang/32/7727_2.png) [@Stephen\_K\_ojwang](https://forum.getodk.org/u/Stephen_K_ojwang)\
**Post date:** [September 29, 2026, 4:10pm UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/2 "2026-09-29T16:10:47Z")

</div>

This issue is discussed here: [https://docs.getodk.org/collect-troubleshooting/#:~:text=the%20forum.-,XPath%20evaluation%3A%20type%20mismatch%20-%20This%20field%20is%20repeated,-¶](https://docs.getodk.org/collect-troubleshooting/#:~:text=the%20forum.-,XPath%20evaluation%3A%20type%20mismatch%20%2D%20This%20field%20is%20repeated,-%C2%B6)

If you are sure product\_name is unique the I suggest try using join in the lookup expression.

---

<div class="post-metadata">

**Author:** ![jurrefws](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jurrefws](https://forum.getodk.org/u/jurrefws)\
**Post date:** [September 30, 2026, 12:34pm UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/3 "2026-09-30T12:34:52Z")

</div>

i had tried to use join() in the lookup expression , it does not work.

---

<div class="post-metadata">

**Author:** ![Stephen\_K\_ojwang](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/stephen_k_ojwang/32/7727_2.png) [@Stephen\_K\_ojwang](https://forum.getodk.org/u/Stephen_K_ojwang)\
**Post date:** [September 30, 2026, 3:09pm UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/4 "2026-09-30T15:09:19Z")

</div>

What is the error message? Confirm that you have used it correctly;

join(" " , instance('productsxml')/root/item[product\_id = ${p\_name}]/product\_name)

---

<div class="post-metadata">

**Author:** ![jurrefws](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jurrefws](https://forum.getodk.org/u/jurrefws)\
**Post date:** [October 2, 2026, 12:35pm UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/5 "2026-10-02T12:35:00Z")

</div>

yes i am using it correctly as you have told but still it only works in enketo not in collect.

[ODK collect .xlsx](https://forum.getodk.org/uploads/short-url/zht23mYowyFd5GhTBKB3Vm4cgw3.xlsx) (8.9 KB)

---

<div class="post-metadata">

**Author:** ![jurrefws](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jurrefws](https://forum.getodk.org/u/jurrefws)\
**Post date:** [October 2, 2026, 12:37pm UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/6 "2026-10-02T12:37:07Z")

</div>

I have another question on the same form.  
In this form i am using a   
 tag in one of my calculations, which is working fine in collect, but is not working in enketo. Please tell me about a break line feature which will work in enketo and collect also.

---

<div class="post-metadata">

**Author:** ![jurrefws](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jurrefws](https://forum.getodk.org/u/jurrefws)\
**Post date:** [October 2, 2026, 1:01pm UTC](https://forum.getodk.org/t/instance-is-showing-error-in-collect-you-may-need-to-use-indexed-repeat/58620/7 "2026-10-02T13:01:33Z")

</div>

yup , its working fine , i was using [1] at the end of formula, when i removed that than its working fine in collect also.  
Thanks alot
