Dear KoboToolbox Community,
I hope this message finds you well. My name is Eduardo, and I am a student at Harvard University.
I am currently designing an XLSForm where each respondent is randomly assigned two different guides (images) from a set of 20 and then asked a series of feedback questions about each. My goal is:
-
To randomly assign each respondent two distinct guides using calculated fields.
-
To ensure the selected guides are displayed as images before respondents answer related questions.
-
To include conditional logic so that follow-up questions only appear based on the respondent’s answers.
However, I keep encountering the following error:
FormLogicError: Could not evaluate: First assigned guide, message: not sure how to handle expression called on nodeset that doesn’t start with a ‘/’: assignedguide{“stack”:[{“t”:“root”,“tokens”:[{“t”:“arr”,“v”:}]}],“cur”:{“v”:“assignedguide”}}
I suspect the issue is with how I am implementing the randomization and selection of images within my XLSForm. Specifically, I am using:
• calculate random1 = once(int(random()*20)+1) to generate a random number between 1 and 20.
• calculate random2 = once(int(random()*20)+1) while ensuring it does not equal random1.
• choice_filter=“number=${random1}” to match the randomly generated number to an image in the choices sheet.
Despite these efforts, the error persists, and I am unable to preview the form.
I have attached my XLSForm for reference and included the link to my form: [Insert KoboToolbox Form Link]
Any guidance on fixing the randomization logic and ensuring that each respondent is assigned two different images correctly would be greatly appreciated.
This is a link for the code I used: [DraftForm.xlsx - Google Sheets]
Thank you in advance for your help!
Best regards,
Eduardo