Select to view content in your preferred language

Failed to parse ${contractorsphone} since contractorsphone cannot be found in the current parsing scope.

751
6
03-14-2023 09:00 AM
hherrmann_coj
Regular Contributor

Hello all,

I am trying (for my first time) to create a Word template for an inspector here in our organization, for Survey123 in our Enterprise/Portal environment.  However I am getting a parse error for ONE field that matches everywhere it should.  I was hoping to get some feedback from those of you with more experience on how I can correct this.  I have included screenshots of the portion of the survey in Survey123 Connect, the Word template I'm trying to build for the inspector's use in notifying those needed, and also the error I received when trying to upload the template to the survey.

Thank you for any assistance/advice you can offer!

Survey123 Connect


EXCEL_BlwhTpqcID.png

Word template

WINWORD_o6UyNzOt4b.png

 Error message when trying to upload to manage templates in Survey123

chrome_niCutsrP8c.png

0 Kudos
6 Replies
MatthewCarey
Regular Contributor

Have you tried using the Create Sample Template button under the Manage Templates window? I've always found that very useful for troubleshooting. If the sample template works OK maybe you can identify any differences in closing and opening tags and things like that.

Also it might be worth posting more of your xlsform and template here in case there are additional complicating factors that aren't apparent from what you've shared so far.

Hope this helps!

 

 

0 Kudos
hherrmann_coj
Regular Contributor

I didn't even see that I could do that.  Such a newb.  LOL!  I'll try that and see if that helps resolve my issue.  Thank you so much for your feedback!  I really appreciate it.  I'm sure I'll be posting more questions as I go through this process to assist in making the job of our Sedimentation and Erosion Control Inspector's life a little easier for him.  🙂

0 Kudos
MattEdrich
Frequent Contributor

This is an error I get commonly when I have missed the opening or closing of a (possibly nested) repeat in my report template. I don't see any repeats in what you've shared though, so my only guess would be that it is possible the ${contractorsphone} field was added to the survey form, but the updated form itself hasn't been published yet. If that is the case, I believe that a template with the ${contractorsphone} field wouldn't think it is in the form schema, even though on your XLS (and even Survey123 Connect), you can see the field.

0 Kudos
hherrmann_coj
Regular Contributor

So I republished the survey after seeing your comment, and lost all of the test data we had put in the survey.  Thankfully it was just test data but after doing some research on what changes can be made that won't cause data to be lost, I'm pretty sure adding a field, among other simple change tasks, wouldn't be overwritten.  However it was.  Now I'm waiting on the inspector to go through the survey with a fine tooth comb so we can make any changes now and he can give a final approval so we don't have to republish it anymore once he starts actually using it in the field.  It was frustrating to make such a simple change and then lose data because of it.  


0 Kudos
MattEdrich
Frequent Contributor

Oh yikes, sorry about that. Thankfully it was just test data! For what it's worth, I believe that particular snafu is a rite of passage amongst Survey123 creators - I know I have certainly done it. In order to avoid that, I have started making two copies of any and all surveys I make, one with [DEV] before the survey name and one with just the plain old survey name. The [DEV] version works as my sandbox/troubleshooter and only ever contains trash data that is only collected to test survey features; the plain-named version is the live one that I don't ever mess with once development is done.

I should have mentioned that could possibly happen, but since I am not seeing any repeats in your XLS beyond the additionalsitephotos one at the bottom, I didn't expect publishing the newest version of the survey to have wiped the data that was previously collected. When I run into that particular warning (Survey123 Connect warns me before publishing that data will be wiped in these cases - did that not happen for you???), it is almost always because I am trying to make changes to a schema with multiple association levels (repeats within repeats), or I am trying to alter the data type of a particular variable (say, switching an integer to a decimal) on which data has already been collected and stored. You are correct that simply just adding a field to the form, your data should not be wiped.

If you still haven't worked this out, feel free to either post you XLS and .docx files (survey table and word document template) here - or DM them to me if you like - and I will see if I can fiddle with stuff on my own to solve this for you!

0 Kudos
hherrmann_coj
Regular Contributor

I'm attaching two screenshots of the full survey in case that helps either of you see any blatant mistake I've made in the form that could be affecting this one field when uploading the form template.

Thanks!

S&ESurveyForm1of2.png

S&ESurveyForm2of2.png

0 Kudos