Not your standard "Note" question; email link

9494
50
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

50 Replies
CraigPoynter
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
HilaryMelton1
New Contributor II

Thanks for sharing your workflows. Does anyone know if there is a way to add information collected in the survey into the subject line? I tried adding it directly into the calculation for the "Send Email Request Text", and I also tried creating another field similar to the Send Email Body. The calculation works correctly in the app but once the email is launched, the subject line reads as "/'form name'/'field name'" instead of what was calculated for that field. 

0 Kudos
by Anonymous User
Not applicable

Hilary,

I wonder if you could use this variant?

You need to revise the concat() function a little bit; not sure if the screen shot will come through. I would post the entire line together, but then some HTML will be displayed. if you take the hard return out and combine the 2 sentences together, then you will have the code that I think should work for what you want. The ${SendEmailRequestText} represents the value of the field or other information that you want to pass along. The biggest thing was to update the concat() function to create the proper hyperlink format to pass the information into the new email.

concat('<a href="mailto:mbruening@envsi.com;ckemmerer@envsi.com?&cc=',${EmailNamePass},

'&subject=',${SendEmailRequestText},'&body=',${Email_Body_Text},'">Link to email info</a>'

Cheers!

Mike

0 Kudos