1. Home
  2. Forms
  3. Eloqua Forms
  4. Pre-populating Eloqua Form Fields

Pre-populating Eloqua Form Fields

Summary

A Web Data Lookup is JavaScript code provided for the purpose of retrieving visitors’ or contacts’ data from Eloqua. In the case of form field pre-population, the Data Lookup would display the data retrieved from Eloqua in the corresponding form field.

When using an Eloqua form in a content track, a visitor’s email address could be retrieved from your Eloqua database and displayed in the email address form field.
This saves the visitor time from entering it into the form.

Setting Up Eloqua Form Field Pre-population

  1. In Eloqua, browse to Settings > Setup > Web Data Lookup. Click the Data Lookup list and select New Data Lookup.
  2. Type a name for the Lookup and select Visitors as the Data Lookup Type.
  3. Under Data Fields Returned click Edit and ensure that the Email Address and any other fields that you will pre-populate in the form are included in the view.

    The video below demonstrates these steps:

  4. Once the above 3 steps are completed click Save in the bottom right corner. A menu called Data Lookup Options will appear in the top right corner. Open the menu and select Get Data Lookup Scripts.
  5. On the next page select the option Form Auto-Population Script. In the drop-down list underneath, select the form to use in your PathFactory content track and click Generate Script for Form.
    Note
    Observe the instructions highlighted in the yellow boxes as to where each script should go on the form webpage.

    The video below demonstrates steps 4 and 5:

  6. In your webpage, ensure that you have the following snippets of code in the sequence mentioned below:
    • Eloqua form code: Retrieve from Gear icon > View Form HTML. Remove any pre-population from the fields (highlighted in yellow) and save the form before copying the code.
    • Form Auto-population script: created in step 4 above.
    • Eloqua general tracking scripts: these are the scripts that you place on any webpage that you want to track in Eloqua.
    • Integration script: also created in step 4 above (the second box in the screen).

      The video below demonstrates this step:

  7. There is one final modification that needs to be made to the code pasted onto the page above before it is ready to be used:
    • In the source code, search for the string FieldHTMLName.
    • Replace the text FieldHTMLName with the HTML field name of the form. The HTML field name of the form can be found within the Eloqua form once you have selected the form field.
    • Replace ContactFieldName with the name of the visitor field as it appears in the Data Lookup.
    • Repeat that line for each form field that you want to pre-populate.

      The video below demonstrates this step:

  8. Your Data Lookup is ready to be used.
    You can copy the code from the webpage you created and paste it as a Custom HTML Form in the Forms Library.
Warning
Any customization, changes or additions to the script code described above should be done in consultation with a JavaScript developer. PathFactory does not provide support for Eloqua JavaScript Web Data Lookups.
There could be numerous reasons why your Web Data Lookup might not work. For example any typo in the code will cause the Lookup to fail. Inspect your code carefully!
Updated on April 14, 2023

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT