# Tutorial: Embedding UT Box "Widgets" into Qualtrics Forms

The University offers a range of tools for accomplishing tasks through the web.  In today's blog post we are going to briefly describe how Qualtrics and UT Box can be used together to accomplish file uploading with form submission.

Qualtrics is a web-form service that allows researchers and others to create simple or complex web forms to collect user input, often in the form of surveys.  The input is stored and can be emailed to the form owners upon completion.  However, one drawback using Qualtrics is that our University license does not allow users to upload/submit files with their forms or surveys.

UT Box is a free cloud-storage and filesharing service available to UT Austin faculty, staff, and students for business and academic purposes (check out this CNS IT Blog post from September 19, 2016).  One neat feature of Box is that you can create an upload widget that allows users to directly upload files into a folder in your Box account without allowing them to see the contents of the Box folder.

In today's post, I am going to show you how to insert one of these widgets into your Qualtrics form.

2. Create a new folder by clicking the "+ New" button.
3. Once the folder is created, it will appear in the list of folders you have access to, while on the right-hand side of the file list there will be the options "Share" and "...".
4. Click "...", mouse over "Sharing", and click "Upload Embed Widget".
5. This takes you to an overlay that allows you to change some options.  Once you are pleased with the settings, look for a text box that says, "Copy and paste this code into your Website".  Copy that code to your clipboard and paste it into a plain text file, keeping it handy.
6. Unfortunately, qualtrics does not allow the javascript functionality that UT Box assumes is available.  However, there is a workaround --- but it can be a little tricky!
1. Take your copied code (for example):

 
2. In the script tag, take the URL in quotes that is the value of the src attribute ... this URL is basically defining the location of the javascript file that is to be used.  In our example, the URL starts on the first line and continues on the second line:

4. This javascript file uses the document.write function to write an iframe element into the page.  Qualtrics does allow us to embed iframes into forms and surveys, so the best course of action here is to directly use the iframe that this javascript file is trying to insert.  To copy the iframe code, you need to view the page source of the script you just loaded in your browser.  (This can be accomplished on most browsers by right-clicking a blank spot on the page and clicking "View Source".
5. Continuing with our example, you will see something like this embedded in the page source:

 document.write('');
6. Now take the portion inside the parentheses and single quotes of the document.write method.  In this case, it is:

 
7. Note that this code block is an HTML tag and close tag that together define an iframe. You can tell it is because the HTML tag (everything within the first angle brackets) starts with  'iframe', while the closing tag is </iframe>. Save this entire code block somewhere handy.

7. So now that we have the iframe that we need in step 6, in step 7, we will insert it into our Qualtrics form.  Login to Qualtrics and navigate to the form where you wish to insert the iframe — which, as you remember, will let users directly upload files into a folder in your Box account.
8. Create a new question in your survey wherever you would like it to appear and set the question type to: "Descriptive Text".
9. Click on the existing text, and then click on "HTML View" (the tab looks grayed out, but it is clickable):
10. Paste the iframe tags you got in step 6g into the HTML View:
11. Click out of the box and you will see in the preview that your upload widget appears.  If you do "Preview Survey", you will see that you are now able to submit a file.