Back to Integrations
    FO

    Voice Capture for FormAssembly

    Add voice responses to a FormAssembly open end with one block of custom code. FormAssembly runs your JavaScript on the published form, which is all the widget needs.

    Available

    Before you start

    • A Voice Capture project and its project key. The Free Trial includes 250 credits and asks for no card.
    • Access to Properties > Custom Code on the form you want voice on.
    • The field id of each open end you want voice on. FormAssembly numbers them tfa_1, tfa_2 and so on, and each field's properties panel shows its id.
    • A Hidden Field for the respondent key, so the Voice Capture export and the FormAssembly export can be joined.
    • If your form is served from your own domain rather than the standard FormAssembly host, add that domain under Allowed domains in your Voice Capture project.

    Setup Guide

    1

    Add the widget in Custom Code

    In the form builder go to Properties > Custom Code and paste the block from your dashboard, then click Apply. Replace the field ids with your own: FormAssembly numbers them tfa_1, tfa_2 and so on, and each field's properties panel shows its id.

    Step 1
    <script>
    (function () {
      var PROJECT_KEY = 'proj_XXXXXXXX';
      var SESSION_FIELD = 'tfa_20';   // id of a Hidden Field added to this form
      var QUESTIONS = [               // your answer fields, in order
        { field: 'tfa_5', question: 'q1' },
        { field: 'tfa_6', question: 'q2' }
      ];
    
      function mount() {
        var sf = document.getElementById(SESSION_FIELD);
        var sessionId = (sf && sf.value) ||
            ('fa_' + Date.now() + '_' + Math.random().toString(36).slice(2, 10));
        if (sf) sf.value = sessionId;
    
        var wraps = [];
        QUESTIONS.forEach(function (q) {
          var el = document.getElementById(q.field);
          if (!el || el.getAttribute('data-gv-done')) return;
          el.setAttribute('data-gv-done', '1');
    
          var w = document.createElement('div');
          w.setAttribute('data-project', PROJECT_KEY);
          w.setAttribute('data-target', '#' + q.field);
          w.setAttribute('data-session', sessionId);
          w.setAttribute('data-question', q.question);
          w.setAttribute('data-lang', 'es');
          el.parentNode.insertBefore(w, el);
          wraps.push(w);
        });
    
        var s = document.createElement('script');
        s.src = 'https://api.voicecapture.ai/voice.js';
        s.onload = function () {
          wraps.forEach(function (w) {
            if (window.GeniusVoice && GeniusVoice.init) GeniusVoice.init(w);
          });
        };
        document.body.appendChild(s);
      }
    
      if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', mount);
      else mount();
    })();
    </script>
    2

    Put voice on more than one open end

    The block takes a QUESTIONS array: each entry pairs a field id with a short label that travels with the recording. Add one entry per open end you want voice on and they are mounted independently, each with its own microphone, so a long form can carry voice on three or four questions without a second snippet. The labels are what let you tell the answers apart in the export, so give them names you will still recognise later.

    3

    Test on the published form, not in Preview

    FormAssembly runs custom JavaScript only on the published form. In Preview the block never executes, so the microphone simply will not appear — that is expected and is not a sign the setup is wrong. Open the live form link, record ten or fifteen seconds and let it finish uploading before you submit.

    4

    Confirm the transcript reaches your data

    This is the step most setups skip, and it is the one that catches a silent failure. Watch the Voice Capture dashboard: the transcript should land within about half a minute. Then submit the form and check your FormAssembly response. The transcript should be sitting in the answer field itself, and the hidden field should carry the respondent key. A recording that transcribes perfectly but writes nothing back into the form leaves you with a correct transcript in one system and an empty answer in the other.

    5

    Field it, then export

    Publish as usual. Recordings upload and transcribe during fieldwork, so the open end is readable while the form is still live rather than at the end. Export to CSV on any plan, or to Excel on a paid credit pack, and join it to your FormAssembly export on the respondent key.

    If something does not work

    The microphone does not appear on the form

    You are almost certainly looking at Preview. FormAssembly runs custom code only on the published form, so open the live form link and test there.

    The microphone appears but nothing is transcribed

    Check the project key in the block first. If the key is right and the form is served from your own domain, add that domain under Allowed domains in the project.

    Transcripts arrive but cannot be matched to submissions

    The Hidden Field id in SESSION_FIELD does not match the field on the form. Outside Alchemer the respondent key is what ties the Voice Capture export to the FormAssembly export, so without it the two cannot be joined.

    Limits

    • Each voice-enabled field needs its own entry in the QUESTIONS array, identified by its tfa_ id. A field that is not listed keeps its normal typed input.
    • The microphone requires HTTPS, which FormAssembly serves by default.
    • Custom Code does not run in Preview, so every test has to happen on the published form.
    • The block matches fields by id, so it works on single-line fields as well as paragraph fields — but if you renumber or rebuild a field, its id changes and the entry has to be updated.

    Full walkthrough

    The step-by-step guide, including the verification step that confirms the transcript actually lands in your form data.

    Read the FormAssembly guide

    Need help?

    Our AI assistant can walk you through the setup step by step.

    Open AI Chat

    Your next study deserves better insights

    Set up Voice Capture in under 5 minutes. No credit card. No commitment.

    Get Started Free
    © 2026 Voice Capture. All rights reserved.

    We use cookies to improve your experience and analyze site traffic. Learn more