Create a custom form data provider

Last updated Monday, January 23, 2017 in Web Forms for Marketers for Developer, Administrator
Keywords: Databases, Web forms

The Web Forms for Marketers module lets you create your own data provider, enabling you to control the storage and extraction of form data. You may also need to create a custom data provider if you work with a data source that cannot be accessed by a standard SQL Server driver.

To write a custom form data provider:

  1. In Visual Studio, create an empty class library project.
  2. Depending on your needs, you can create the data provider in the following ways:
    • If you need to change the behavior of some methods and keep the functionality of others, inherit your class from one of the following classes, SqlFormsDataProvider, CombinedFormsDataProvider or AnalyticsFormsDataProvider and overwrite the relevant methods.
    • If you need to write a new data provider class with its own functionality, for example to manipulate form data for analysis, write a class that implements the IWffmDataProvider interface.
  3. Place the .dll file containing your data provider in the website's \bin folder.
  4. In the Sitecore.WFFM.Dependencies.config file, find the configuration node /sitecore/wffm/analytics/formsDataProvider and set the attribute reference to the new data provider.

    If you want to ensure that the data source contains the form data, restart your web server and generate some activity with forms by entering data. Submit the form and open Form Reports from the Sitecore Desktop, and export the form data to a file.

Send feedback about the documentation to docsite@sitecore.net.