Not your standard "Note" question; email link

15860
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
KarinaLivingston
Occasional Contributor

Hello, were you able to figure this issue out? I am having the same problem but have had no luck getting the body of the email to populate in the web survey. 

0 Kudos
KarinaLivingston
Occasional Contributor

We were finally able to get the body of our email to populate in the web form and pull variables from our survey. This is the code we used in our calculation field for our note. Hope it helps!

concat(‘<a href="mailto:’,${email},’?subject=Annexation Application Invoice&amp;body=Good Afternoon ’, ${owner},’,%0D%0A%0D%0APlease see the attached annexation application invoice. This payment will cover all attorney, recording, and processing fees. Payment is due within 30 days. Please note that an unpaid balance greater than 90 days will inactivate this annexation application and will require a new application and payment to proceed.%0D%0A%0D%0AIf you have any questions or need any additional information, please do not hesitate to contact Elba Cendejas at (772) 466-1600 Ext. 3227 or email AR@fpua.com. %0D%0A%0D%0AThank you,%0D%0A%0D%0A”>Email</a>’)

 

0 Kudos
CPoynter
Occasional Contributor III

Hi Mike Bruening, is it possible using this method to capture repeat data into an email?

Regards,

Craig

0 Kudos
by Anonymous User
Not applicable

Keep in mind that you will most likely need to edit a few of the parameters within the

  1. Email_Body_Text
  2. SendEmial_Request

This will send emails to my coworker and my own emails if you use it directly; I guess I should have changed those.

I would suggest using the free Notepad ++ editor to help with editing these.

0 Kudos
TimoSjösten
New Contributor II

Thanks for sharing. Got this working fine together with my desktop e-mail client "Outlook". A prefilled message opens nicely when using the desktop version but when I go mobile and use Outlook for Android app it just opens an empty message form. Have anyone got this working together with Android email clients? Any comments much appreciated. 

0 Kudos
by Anonymous User
Not applicable

Timo,

I was able to successfully transfer and create a new email within Android 6.0.1 on a Moto Droid Turbo selecting GMail and also the Outlook for Android mobile app. I wonder if there is a bug associated to the device and it's OS version that you are attempting this on?

0 Kudos
TimoSjösten
New Contributor II

Thanks Mike for your quick reply. Meanwhile I got it working on my android Outlook mail client also. It works like charm now

My wild guess is that the double sequence marks ?& could have been the reason.

Tweaked around a bit and my line looks like this now: ...a href="mailto:',${Email_Name2},${Email_Name},'?bcc=...

with ?bcc not ?&bcc

I'm so happy that I found this thread. This is a great workaround while we wait for a built in feature to export/e-mail a survey directly from the app.

by Anonymous User
Not applicable

Timo,

I am glade you got things to work out properly and yes what the Survey123 team has given us the ability to accomplish has been awesome.

0 Kudos
OscarSepulveda_III
Occasional Contributor

How can the form be designed to complete two tasks at once.  Meaning that when you hit 'Submit' the form will automatically email and upload to the cloud.  I know that many people will not remember to go back to the form after emailing and finish submitting. #email survey submit survey

Mike Bruening this is working beautifully! Again thank you!

by Anonymous User
Not applicable

Oscar,

That is a good questions and one I'm unsure of as of right now. Unfortunately for me, we have hit my busy season and I am currently under deadlines that have to be meet. So, I cannot look into this, but I wonder if there is a way to trigger the email through a condition of pressing the submit button?

Meaning, is there a variable created upon submit, that would enable the email hyperlink without the click action? That's kind of the logic that I am getting. Submit the form and then the emails are sent?

I remember that someone on this forum; not this thread, had created a scheduled window's event that would enable a python script that would check a hosted feature service fora  certain variable within the service. If it was submitted before a certain time limit, then it would convert it to a PDF and email it. I wonder if there is some way of constructing a python script that could look at the feature service in the same manner, but the end result would be the email hyperlink function?

0 Kudos