Send User a Customized PDF After Exam Completion | XM Community
Solved

Send User a Customized PDF After Exam Completion

  • 14 August 2018
  • 9 replies
  • 810 views

Hi everyone,

I am using Qualtrics to give a test to our distribution agencies for their food safety certification. If they complete the test successfully, they need to be sent a certificate with their name and expiration date on the certificate. In the past, we did this via Wordpress to generate a PDF. Is there some sort of JS code or API that enables this functionality for Qualtrics? I can't seem to find any support on how to do this.

Any pointers in the right direction or leads would be helpful, and examples would be even more so. Ideally, I'd like to use something like PDFKit, but I'm not sure that is a viable option.

Thanks for any help!
icon

Best answer by TomG 14 August 2018, 16:52

View original

9 replies

Userlevel 7
Badge +33
One thing you can do is to send trigger email, this you can draft in your way (piping names, setting expiration date)
but automatically updated pdf file using trigger email seems difficult.
One of the solutions I'm working with is to send the piped variables to our webspace and then embed it in the PDFKit code, but this is a really roundabout way to do something that shouldn't be so complex.

I'm hoping that someone has found an API that can accomplish something along these lines.
Userlevel 7
Badge +27
The way I've done this in the past is at the end of survey redirect to a php script with SurveyID and ReponseID as parameters, use v2.5 of the Qualtrics REST API to grab the response data, then have the php script generate the pdf using FPDF and output it directly to the browser.
Userlevel 7
Badge +38
@FBMacCallum I work in higher education and we delay our certificate sends by one day.

At the end of the survey we customize the End of Survey message and send a trigger email letting them know certificates are processed the following day. Within that survey I have also set up 7 scheduled emails of a results report to get the send to happen daily.

* Create a custom page that has all the information you need in one visual - fist name, last name, recorded date
* Create seven scheduled emails - set to send weekly every Monday, Tuesday, Wednesday... @ time
* Attach the report as a .csv
* The filter on your results report should be - Status Finished, Recorded Date = Yesterday


I then use a series of Macros and VBA to save the attachment to the proper drive, format and save as a PDF. Ron de Bruin shares a lot of VBA code that is incredibly useful:

http://www.rondebruin.nl/win/section1.htm

I also use Windows scheduler to trigger a VBA script that executes the Macros that I have created. This has been working well for us on two major projects, and is set to be deployed on a third.
@TomG : This sounds like exactly what we are trying to accomplish. Could you expand a little bit on how you set this up, or have any sample code for this? It sounds like a great resource!

@bstrahin : We are unfortunately looking for a solution that prints at the moment of completion as it needs to be displayed for agencies to complete distributions, and most agencies do this last minute. Also, our non-profit doesn't have a dedicated computer to stay on and issue these regularly with a scheduler. Otherwise, this would be a fantastic solution!
Userlevel 7
Badge +27
> @FBMacCallum said:
> @TomG : This sounds like exactly what we are trying to accomplish. Could you expand a little bit on how you set this up, or have any sample code for this? It sounds like a great resource!

For a variety of reasons, the code isn't suitable for posting here. I've updated my original answer with some helpful links. You'll need a web server or web hosting account with php. You'll also need fairly strong knowledge of php in order to create the necessary code.
Our web hosting is through a contractor that is maintaining the webspace, so hopefully we can get them to add our necessary dependencies and code. It's kinda the same problem I'm running into with the PDFKit option.

Going back to the root issue, it is sounding like there is no way natively to do this in Qualtrics.
Userlevel 7
Badge +6
> @TomG said:
> The way I've done this in the past is at the end of survey redirect to a php script with SurveyID and ReponseID as parameters, use v2.5 of the Qualtrics REST API to grab the response data, then have the php script generate the pdf using FPDF and output it directly to the browser.
>
>

I love this answer. I think the G in TomG stands for "gems" because that is what he is providing!

I need to understand this WAY better, but this seems like very feasible solution for anyone trying to generate a pdf at the end of a Qualtrics survey/form.
Userlevel 7
Badge +27
Since this was brought back up, v2.5 of the API is only available to those who were grandfathered in, and will soon be removed for those people as well. So, getting the response is a couple of more steps with the new version of the API, but still doable. A trick with the new API is to pass in a start time so you can find the response much quicker.

Leave a Reply