FormLogicError in survey123 webapp with relevant field: Context node was not supplied

2247
12
11-07-2019 01:56 AM
FernandoBenitez
New Contributor II

Hi everyone, 

I have an extensive survey (10 pages) that works perfectly in any of the Survey123 apps, but when I launch on the web, the form could not initialize,  showing up an error like 

FormLogicError: Could not evaluate: (selected( /model/instance[1]/Encuesta_Ocupaciones_v2/info_loc_predio/tipificacionOcupacion , 'vivienda') or selected( /model/instance[1]/Encuesta_Ocupaciones_v2/info_loc_predio/tipificacionOcupacion ,'viviendaOtro')), message: Context node was not supplied. 

What I have is a select_one list attribute ((tipificacionOcupacion) ) which lists 5 options, (Vivienda, viviendaOtro, cultivos , pastoreo). Later on, I have a set of questions in a repeat group that need to show only if two of the aforementioned options were chosen. 

I have tried several options, but nothing seems to work.

(selected(${tipificacionOcupacion}, 'vivienda') or selected(${tipificacionOcupacion},'viviendaOtro'))

selected(${tipificacionOcupacion}, 'vivienda') or selected(${tipificacionOcupacion},'viviendaOtro')

${tipificacionOcupacion} = ('vivienda', 'viviendaOtro')

regex(${tipificacionOcupacion}, "vivienda|viviendaOtro")

regex(${tipificacionOcupacion},'vivienda|viviendaOtro')

Advice is greatly welcome because of I kind of desperate with this issue for all my surveys with multiples options chosen in a select_one list

 

Fernando Benitez

12 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Fernando,

Could you share the xlsx file?

FernandoBenitez
New Contributor II

Hi James,

yes I can, find it here enclosed, Looking forward to your insights,

just to make more clear, due to the survey is kind of big.

The field (row 18) is a select_one list (tipificacionOcupacion), once the user ticks Vivienda or Vivienda Otro, the repeat group in row 60 should appear if the user chooses the rest two options then this repeat is not displayed. Likewise, the note field (row 59) should be displayed only when user tick the options, Cultivos or Pastoreo. When I do the relevant for one choice works perfectly but when I add two options for this relevant then I got the error, once I display the survey on the web. I hope I’ve been clear. Please let me know if you have any questions,

warm regards

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Fernando,

Apologies for the late reply.  It looks like the issue is when a repeat with a relevant statement is within the group.  Could you apply the relevant statement to the group it's in (or make the repeat a page by itself)?

ElisabettaMattioli
New Contributor II

Hi James, 

I'm experiencing the same issue, I have a repeat with a relevant statement (it is not within a group) triggering the same FormLogicError in the web app. The same form works fine in the field app. Just for testing, I applied the ?version=3.0 URL parameter at the end of the Survey link in the web and the FormLogicError does not appear anymore.. does it make sense for you? Could it be a workaround or just a coincidence? I'm configuring the survey for people who are beginners and I really would like to be sure that the configuration works perfectly in any environment. Thank you

James Tedrick

survey123 connnect‌

#survey 123 repeat

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Elisabetta,

I would need to see the form to understand if this is the same issue; that being said, repeats are a type of group, so I could see that this could be the same issue.

ElisabettaMattioli
New Contributor II

Hi James,

Thank you very much for your reply, I can’t say how many times your hints, answers and suggestions in the forum helped me out to address all kind of issue or doubts!

 

I’m dealing with the repeats group for the first time.

Please, find at the links below a couple of excel giving the same result when used in web app (both work well in the field apps and in the web app if I add the URL parameter ?version=3.0). I’m sorry they are both quite messy, because they work on the same service and I did not have the time yet to clean up the useless rows in each one.

IOV24 Survey

IOV25 Survey

 

I get advantage for asking you a couple of things more:

  • In both the example I’m sending you, I would like to be able to enable the update capability on the repeat section. I tried all the expression I found in the documentation and in the forum. I was able to publish these forms with the allowUpdates=true parameter, but when I tried to update a sent record through the inbox, the app crashes or after 10 minutes waiting for the submission, I got an error. As I couldn’t find a solution, for the moment I’m limiting the field capabilities and preventing the updated, but actually it would be really useful for the field workers. Any suggestions?
  • Thirdly.. is there something happening in the Survey123 environment in the last couple of days? We are struggling with some kind of services disruptions, anomalous behaviors, very long time to update and publish. Please, see for example the Error: 499 Error transferring https://survey123.com/api/xls2xform - server replied: gateway Time-out

 

Thank you very much!

Best Regards

Elisabetta

0 Kudos
FernandoBenitez
New Contributor II

Hi James, sorry for my late reply...Yeah, I apply your suggestion and indeed worked, which I don't really understand how come this might be an issue. 

0 Kudos
BritaVespere
New Contributor III

Hello, 

I have the same issue but I do not have the repeat inside a group. My survey is quite simple:

I have questions that are multiple choice and one of the choices is 'add other answers' -> Therefore, the repeat itself has a relevance. Inside the repeat is only 1 text question with no added restrictions or settings...

All was fine until I wanted to get rid of the empty related table rows, so I put an appearance 'minimal' for the repeat.

The error: FormLogicError: Could not evaluate: selected( /model/instance[1]/surveyname_v1/jautajums_3 , 'cits'), message: Context node was not supplied.

Is it possible to not have the empty rows in the related table? I do not need to be able to edit that data, the survey is for just capturing data.

Many thanks to any advice!

JamesTedrick
Esri Esteemed Contributor

Hi Brita,

There is an issue when using the minimal appearance with repeat group in the web form currently.  Are you seeing the empty rows get generated when the repeat is not relevant?

0 Kudos