Create a custom form data provider
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:
-
In Visual Studio, create an empty class library project.
-
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
, orAnalyticsFormsDataProvider
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.
-
-
Place the
.dll
file containing your data provider in the website's\bin
folder. -
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.