Select to view content in your preferred language

Help with ODK error- XForm is invalid...Encountered a problem with display condition node

222
3
Jump to solution
2 weeks ago
mcbeth99
Occasional Contributor

I am trying to use 'groups' in my survey which is new for me.  What I am trying to do is, for the question 'how many historic functions are there'... will be an integer answer between 1-3.  If the user enters 2, I'd like the appropriate number of fields to appear on the survey (for 2 it is 4 fields, for 3 it is 6 fields).  I added info to the relevant column and I think I am close but am running into the following error:

 ...XForm is invalid...Encountered a problem with display condition node [${HistoricalFunctionB}] at line:${HFunctionsGroup} ="1","2", Bad node...

 

I've included the spreadsheet, hopefully that will help! Thanks so much.

0 Kudos
2 Solutions

Accepted Solutions
Neal_t_k
Frequent Contributor

Your relevant conditions are formatted incorrectly.  Also since HFunctionsGroup is a group, there are no answers to it, I am guessing you want the relevant to reference ${HowManyHFunctions}

${HowManyHFunctions} ="1"  or ${HowManyHFunctions} ="2" or ...  That needs to be changed for:

Neal_t_k_0-1758632585627.png

I may also suggest  moving to using the selected function instead of "="  it is more robust especially when you use select_multiple:

selected(${HowManyHFunctions},'1') or selected(${HowManyHFunctions},'2')...

https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm

I would also suggest changing ${HowManyHFunctions} to a select_one question having the options 1,2 or 3. You currently don't have it constrained.  There may be other ways, but it is a straightfoward way to constrain the answers and have users know what to expect.

View solution in original post

0 Kudos
Neal_t_k
Frequent Contributor

I think you will also need to flip the order

1 or 2  or 3

2 or 3

3

View solution in original post

0 Kudos
3 Replies
Neal_t_k
Frequent Contributor

Your relevant conditions are formatted incorrectly.  Also since HFunctionsGroup is a group, there are no answers to it, I am guessing you want the relevant to reference ${HowManyHFunctions}

${HowManyHFunctions} ="1"  or ${HowManyHFunctions} ="2" or ...  That needs to be changed for:

Neal_t_k_0-1758632585627.png

I may also suggest  moving to using the selected function instead of "="  it is more robust especially when you use select_multiple:

selected(${HowManyHFunctions},'1') or selected(${HowManyHFunctions},'2')...

https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm

I would also suggest changing ${HowManyHFunctions} to a select_one question having the options 1,2 or 3. You currently don't have it constrained.  There may be other ways, but it is a straightfoward way to constrain the answers and have users know what to expect.

0 Kudos
Neal_t_k
Frequent Contributor

I think you will also need to flip the order

1 or 2  or 3

2 or 3

3

0 Kudos
mcbeth99
Occasional Contributor

Thank you so much @Neal_t_k it worked!  I really appreciate your help!

0 Kudos