Import CSV from existing old site's form to Sitefinity's responses
I have a CSV file and I don't want to lose all the entries. Is there a way to import that file into a new form I've made? It has all the same fields as my new form.
Hi,
The import of CSV file data into forms is not available with out of the box functionality CSV data can be imported into email campaigns module to create subscribers, here is a screenshot.
I suppose the data must be imported into form as form responces, this can be done using forms module API. Query the data from the CSV and populate the form fields using the sample below.
FormsManager manager = FormsManager.GetManager();
//get a form by its name each form have sf_ prefix in the name
var form = manager.GetFormByName(
"sf_formentriesform"
);
//create form entry
FormEntry entry = manager.CreateFormEntry(form.EntriesTypeName);
//set value to the form entrues by specifying in which of the custom on the form to add it
entry.SetValue(
"FormFileUpload"
,
"valuie"
);
entry.SetValue(
"FormTextBox_C004"
,
"string"
);
form.FormEntriesSeed = form.FormEntriesSeed + 1L;
entry.ReferralCode = form.FormEntriesSeed.ToString();
entry.SubmittedOn = System.DateTime.UtcNow;
//save
manager.SaveChanges();
How do you get the Import subscribers dialog box?
Hello,
First you need to create a mailing list. For your convenience, I recorded a video showcasing how to get to the import subscribers:http://screencast.com/t/w92x6tp9FK
Regards,
Atanas Valchev
Telerik