Not your standard "Note" question; email link

6749
50
Jump to solution
05-09-2017 04:14 AM
Highlighted
Regular Contributor

Hello,

I am attempting to use a "Note" question to create a hyperlink to launch an email containing information from my Survey123 form that was built within Survey123 Connect v2.0.35.

I have a set of 6 questions that pertain to project details that I am having our project managers fill out through the Survey123 app. I have a text question that is set to multi-line that contains some text and also pulls in the answers to the 6 questions to create what will be the body text of the email (please see below).

"Hello GIS Department," + "\n"+ "\n"+"This is a request to set up a new GIS application with the following information below:" + "\n"+ "\n" + "Project Number: " + ${ProjectNumber} +"\n" + "Project Name: " + ${ProjectName}+"\n" + "Site Name: " + ${SiteName}+"\n" +  "Company Name: " + ${CompanyName}+"\n" + "ESI Project Lead: " + ${ESI_ProjectLead} +"\n" +  "ESI Field Lead: " + ${ESI_Field_Lead} + "\n" + "\n"+ "Thanks"

Next I have a "Note" question that has a calculation to pull together the hyperlink text that is needed to launch an email and then allow the user to send off the email. That works perfectly (see below).

concat('<a href="mailto:',${Email_Name},'?subject=GIS App Setup&body=',${Email_Body_Text},'">Link to email info</a>')

Next, I want the user to submit the survey form, but this is where things hang up. I receive an error code 1000 "String or binary data would be truncated. The statement has been terminated."

Can anyone provide some insight on what this error means and how to get around the error to allow the survey to be submitted?

Ismael Chivite

James Tedrick

I would greatly appreciate any help or insight.

Thank you in advance,

Mike

1 Solution

Accepted Solutions
Highlighted
Esri Frequent Contributor

Hi. The 'code 1000' error is described in the Troubleshoot—Survey123 for ArcGIS | ArcGIS help topic.  This error is triggered when your survey is attempting to send data (typically a string) that is larger than the feature service field where it needs to be stored.  You can use the bind::esri:fieldLength column in your XLSForm to expllicitly set the size of your fields. For example, by default text fields are created with a size of 255 characters, but you can use that column to make them bigger. 

View solution in original post

50 Replies
Highlighted
Esri Frequent Contributor

Hi. The 'code 1000' error is described in the Troubleshoot—Survey123 for ArcGIS | ArcGIS help topic.  This error is triggered when your survey is attempting to send data (typically a string) that is larger than the feature service field where it needs to be stored.  You can use the bind::esri:fieldLength column in your XLSForm to expllicitly set the size of your fields. For example, by default text fields are created with a size of 255 characters, but you can use that column to make them bigger. 

View solution in original post

Highlighted
Regular Contributor

That was the issue and I greatly appreciate the feedback. I had originally set this value to 300, but my total character length ended up around 400 characters.

Again thank you.

Reply
0 Kudos
Highlighted
Occasional Contributor II

Hi Mike,

This is a great way to get a notification sent out that includes the data captured with the Survey123 form.

Thanks for sharing,

Finnian

Reply
0 Kudos
Highlighted
Regular Contributor

Finnian,

No problem at all and I think this app has the opportunity to turn into to something that we have never seen before.

Good Luck!

Mike

Reply
0 Kudos
Highlighted
Occasional Contributor

 Mike Bruening can you upload an example of the xlsx worksheet so that I can see the complete workflow?  Email is one of my last hurdles before publishing a bunch of forms...

Thanks!

Highlighted
Regular Contributor

Let me know if this comes through or not.

Highlighted
New Contributor III

I'm needing a little more information on this.  I've been through the "Send_Email_Test.xlsx" a few times.  Works perfectly on the stand-alone computer in the office.  Once I publish it, the Email Text Body window only gets "NaN" published to it.  When I attempt to Submit the data in the form, I get a "Failed to submit - Field SendEmail_Request has invalid html content".  

Here is the SendEmail_Request

Email_Body_Text

${SentTo} + "\n" + "\n" + "Actionable Item Detailed Below:" + "\n" + "\n" + "Reference Number: " + ${CallDate} + "\n" + "\n" + "Company Name: " + ${CompanyName} +  "Caller: " + ${Caller} + "\n"+ "Address: " + ${SiteAddr} +"\n" +  "Phone Number: " + ${CallerPhone} +"\n" +"\n" + "Message: " + ${Message} +"\n"  + "\n" + "Thanks," +"\n" +"\n" + ${TakenBy}

+ "\n" +"\n"

Here is the SendEmail_Request

concat('<a href="mailto:outdoor.guy@juno.com?&cc=',${EmailNamePass},'&subject=Email App Test&body=',${Email_Body_Text},'">Click to send email</a>')

Where might I be missing something that the weblink doesn't like?

Reply
0 Kudos
Highlighted
Regular Contributor

Could you share your form with me?

Reply
0 Kudos
Highlighted
Regular Contributor

Jackie,

I was hoping to see your form in order to see the values that are being passed from the answers of your other questions as this could maybe help trouble shooting the concatenation of them. Meaning, there could be special characters that may need hard coded in order for this to work correctly. This is just speculation on my behalf!

Reply
0 Kudos