+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Import CSV from existing old site's form to Sitefinity's responses

Import CSV from existing old site's form to Sitefinity's responses

4 posts, 0 answered
  1. Boulevard
    Boulevard avatar
    8 posts
    Registered:
    08 Jul 2013
    18 Nov 2013
    Link to this post
    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.
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    21 Nov 2013
    Link to this post
    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();

    Regards,
    Stanislav Velikov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Boulevard
    Boulevard avatar
    8 posts
    Registered:
    08 Jul 2013
    22 Nov 2013 in reply to Stanislav Velikov
    Link to this post
    How do you get the Import subscribers dialog box?
  4. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    27 Nov 2013
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered