How to add audio and video responses to Nfield surveys, using Pipe

7 April 2022

If you’d like to incorporate audio and video responses within Nfield surveys, you can do this by integrating Pipe’s recording platform. Below is an example of how this feature might be useful.

Before you start

Incorporating Pipe into Nfield surveys requires specific technical expertise. You’ll need someone who is

Gather your resources

Setting up Pipe

  1. Choose a suitable price plan.
  2. Sign up and sign in to Pipe.
  3. In the main screen, set up your recorder (see below)
Note: You should set the display size according to the device your respondents will use. It is also possible to make the sizing responsive to a range of device screens. Please refer to Pipe’s own instructions for this. 
  1. Click [Generate Embed Code].
  2. Go to the “Add it to your website” box (see below) and find the JavaScript code in the 2.0 JS tab.
  1. Save the values shown for AccountHash and EID (found at the bottom of the “Add it to your website” box). These will be needed later.
  2. By default, audio recording in mobile devices requires a recorder app which respondents may not have. To change to inline recorder,

Script setup

Here is an example of ODIN script that will show an audio recorder and a video recorder. You can also download the script here. See beneath for explanations.

  1. Adds the theme name.
  2. Sets a font that is a bit hidden to hide the payload setting
  3. If working on a specified-respondents survey, each original respondent key is used for mapping the recordings.  
  4. If working on an anonymous survey, this generates a random number which is saved as SecondRespondentKey in the sample table and used to map the recordings.
Note: The higher the random number, the lower the chance of the duplicate SecondRespondentKey being made. You should therefore check this or decide which recordings to pick in the data processing part.  
  1. The theme recognizes “addpipe=true” in UIOPTIONS as an instruction to insert an audio recorder.
  2. The hidden font is now used to hide the text in that line. And it uses [payload=(respondentkey)q(question number)] to pass this information form the script to the recorder.
  3. The theme recognizes “Addpipev=true” in UIOPTIONS as an instruction to insert a video recorder.
  4. Completion of the survey question is acknowledged.
Note: Once each recording is uploaded to Pipe, you might want to add *BACK to prevent re-recording or do a check on re-recordings (spotted by same payload).  

Theme setup

  1. Open nfield.theme.js with a text editor e.g. Notepad++.
  2. Find the following identifiers in nfield.theme.js. The first instance is for the audio recorder and the second instance is for the video recorder.

    accountHash:" YourAccountHash", eid:"YourEID"
  1. Replace YourAccountHash and YourEID with the JavaScript values previously generated in Pipe. (See step 5 in Setting up Pipe.)
  2. Update other parameters according to values generated by your JavaScript.
  3. Zip it and upload to Nfield Manager in the usual way.

Check recording functionality

  1. Click the link to your survey.
  2. As soon as you land on a recording page, your browser will ask for permissions to use your microphone and/or camera as relevant. Click “Allow”.
  1. Test running the surveys and make some recordings.
  2. Go to Pipe, where these should appear in the recording tab, and check the payload value.

Storage setup

  1. Go to the settings icon next to the Production dropdown box.
  2. Check its Region settings.
Note: These recordings will be out of scope of Nfield. You should therefore be aware of the location where the data is stored, along with any different security and compliance levels.  
  1. Go to the Storage tab and select Your storage.
  2. Consider the options for storing in an alternative environment to that provided by Pipe.

Mapping Payload to Filename

It would be too labor intensive to click every individual record to find the payload information (respondent key and question id) to rename its recording file. But you can automate this task by using a webhook to send the payload and file name to trigger file renaming (optimally in batches). Please refer to the Pipe Webhook documentation for how to use their webhook. Alternatively, you can program something yourself or use other codeless automation tools, such as Microsoft Power Automate, to do the work.

We hope you find these instructions useful. Please feel free to share your feedback with us.

Get a first impression, scheduled soon.

Get a first impression, scheduled soon.

Request a demo to see how NIPO can help you meet your requirements with our smart survey solutions.