Select to view content in your preferred language

Not your standard "Note" question; email link

18127
52
Jump to solution
05-09-2017 04:14 AM
by Anonymous User
Not applicable

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

52 Replies
PeterDalrymple
Regular Contributor

This is great functionality! Thanks for sharing.

I have one minor issue that maybe someone can help with or that may help others troubleshoot.

It took me a while to figure out why the ${Email_Text_Body} text was not being passed into the email. Turns out that if the hyper link is selected by the user while the cursor is still in the ${Email_Text_Body} field, the email will launch, but no text will be passed into the email. Selecting the hyperlink won't remove the cursor from the ${Email_Text_Body} field. Since ${Email_Text_Body} is the last question in my survey, it requires some explanation to the user or some sort of work around. In this particular case, I'd prefer not to put another question after the ${Email_Text_Body} question.

Let me know if anyone can think of a solution.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Peter,

Unfortunately, this is a limitation of Survey123 - updating calculations will only occur after the cursor leaves the question (otherwise, this would lead to a lot of calculations as they would occur after every key press).

0 Kudos
YukoYokozawa
Frequent Contributor

Thank you for posting this! I was looking for workaround for emailing survey results without using webhook. This is perfect!