Get custom data from choices sheet for calculation inside repeat

1. What is the issue? Please be detailed.
I would like to get data in a repeat based on the choices selected before the repeat group. I can do this for the name of the Animal but would also like the ID, Location and Sex to appear as notes.

2. What steps can we take to reproduce this issue?
I have attached a minimal version

3. What have you tried to fix the issue?
I’ve tried multiple ways of tackling this, none have worked.

Test.xlsx (20.1 KB)

Hi @Stuart to achieve this your calculations need to be like:

instance('Animal')/root/item[name=${Animal_Name}]/AnimalID
instance('Animal')/root/item[name=${Animal_Name}]/LocationID
instance('Animal')/root/item[name=${Animal_Name}]/SexCode

and you need to add true() to choice_filter column of your select_multiple question.
This would be something like:
Test (1).xlsx (9.4 KB)
You can find a similar example in https://docs.getodk.org/form-logic/#id27

Worked perfectly, thank you so much

1 Like