Survey works in app, errors in web initializing form

1514
5
Jump to solution
02-07-2019 11:24 AM
WayneDodgens1
New Contributor II

Hello, 

I have a survey that pulls data from a CSV file stored in the media folder. Survey works great in Connect and the windows Survey123 app.  However, when launching the survey in the browser it fails with the following error.

Error: Initializing form...

  • FormLogicError: instance "AllterraRates" does not exist in model

Thanks for any help troubleshooting the issue.  We want to exclusively use the survey in the web browser if possible.

I'm using

Connect version 3.2.196

Survey123 on window version 3.3.26

Chrome version 72.0.3626.96

Published to AGOL, currently shared with an internal group

Thanks in advance,

Wayne

Tags (2)
1 Solution

Accepted Solutions
BrandonArmstrong
Esri Regular Contributor

Hi Wayne,

After taking a look at your XLSForm I see that you have included the pulldata function several times within the same calculation column for a question which includes references to values from other preceding questions.  For use with the web app you will need to separate each pulldata calculation into its own question. 

So, in your form, you will need to have 3 separate questions which pull their respective values (these can each be type calculate), then reference those questions in the calculation of a succeeding question which performs multiplication against the values you'd like to reference from preceding questions.  

For instance, you current calculation is the following...

(pulldata('AllterraRates', 'Daily', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) * ${EquipRentalDays} * ${EquipNoUnits}) + (pulldata('AllterraRates', 'Weekly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) * ${EquipRentalWeeks} * ${EquipNoUnits}) + (pulldata('AllterraRates', 'Monthly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) * ${EquipRentalMonths} * ${EquipNoUnits})

You will need to split it up into separate parts so that the web app can process it.  Consider the following...

question_1: pulldata('AllterraRates', 'Daily', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) 

question_2: (${question_1}* ${EquipRentalDays} * ${EquipNoUnits})

question_3: pulldata('AllterraRates', 'Weekly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}'))

question_4: (${question_3}* ${EquipRentalWeeks} * ${EquipNoUnits}) 

question_5: ('AllterraRates', 'Monthly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}'))

question_6: (${question_5} * ${EquipRentalMonths} * ${EquipNoUnits})

question_7: (${question_2}+ ${question_4}+ ${question_6})

I will upload an example of an edited version of your XLSForm which is working upon making these changes.

Let me know how it goes.

Best,

Brandon

View solution in original post

5 Replies
BrandonArmstrong
Esri Regular Contributor

Hi Wayne,

After taking a look at your XLSForm I see that you have included the pulldata function several times within the same calculation column for a question which includes references to values from other preceding questions.  For use with the web app you will need to separate each pulldata calculation into its own question. 

So, in your form, you will need to have 3 separate questions which pull their respective values (these can each be type calculate), then reference those questions in the calculation of a succeeding question which performs multiplication against the values you'd like to reference from preceding questions.  

For instance, you current calculation is the following...

(pulldata('AllterraRates', 'Daily', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) * ${EquipRentalDays} * ${EquipNoUnits}) + (pulldata('AllterraRates', 'Weekly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) * ${EquipRentalWeeks} * ${EquipNoUnits}) + (pulldata('AllterraRates', 'Monthly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) * ${EquipRentalMonths} * ${EquipNoUnits})

You will need to split it up into separate parts so that the web app can process it.  Consider the following...

question_1: pulldata('AllterraRates', 'Daily', 'Equipment',  jr:choice-name(${Equip}, '${Equip}')) 

question_2: (${question_1}* ${EquipRentalDays} * ${EquipNoUnits})

question_3: pulldata('AllterraRates', 'Weekly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}'))

question_4: (${question_3}* ${EquipRentalWeeks} * ${EquipNoUnits}) 

question_5: ('AllterraRates', 'Monthly', 'Equipment',  jr:choice-name(${Equip}, '${Equip}'))

question_6: (${question_5} * ${EquipRentalMonths} * ${EquipNoUnits})

question_7: (${question_2}+ ${question_4}+ ${question_6})

I will upload an example of an edited version of your XLSForm which is working upon making these changes.

Let me know how it goes.

Best,

Brandon

WayneDodgens1
New Contributor II

Brandon, 

Thanks for reviewing and the reply.  Splitting the pulldata functions up did the trick. I had to republish as a new survey because the original survey would hang on the 'Getting form information' step of the publish process after making the suggested changes. But that is minor.

Perhaps adjust the documentation to clarify that only one pulldata() function per calculate field is allowed?

Thanks to you and the Survey123 team for being so responsive on this forum and the continued development of the tool. We keep finding new uses for the surveys. 

Wayne

0 Kudos
CUARTA_OPORTUNIDADLOCAL
New Contributor III

Hi Brandon Armstrong, I am having now the same problem that Wayne. I have some pulldata functions in my survey, and when I try to open it in the web page it appears to me the message:


Error: Initializing form...


Although it is a little weird because the first pulldata function works perfectly, and the second does not, but both of them work in the survey App. I have already done what you said, splitting the functions, but it still does not work.

Documents:

Archivos geonet - Google Drive 

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi LILIANA JURADO‌,

After taking a look at your XLSForm and external CSV's, it appears that this issue is being caused by an empty column in your 'Caligeo' CSV.  Please delete this column in the CSV, save, and republish the survey using Survey123 Connect.  Let me know if this resolves the issue.

Best,

Brandon

CUARTA_OPORTUNIDADLOCAL
New Contributor III

Hi Brandon!

You were totally right, I have deleted that column and everything now works great.

Thank you very much!!