Import List Instances and their data with Mavention Import List Instance (use the VS plug-in to export List data definitions)

Source: Internet
Author: User

When working with custom Lists you find yourself often redeploying the List and creating some test data to verify that everything is working correctly. entering sample data may be fun to do once but becomes rather boring after a few times. find out how to reuse your sample data in the development process using Mavention Import List Instance.

SharePoint Lists and test data

SharePoint Lists are a great place for storing data in SharePoint. They are very flexible, highly customizable and out of the box contain rich functionality. Not surprisingly SharePoint Lists are being used in solution.

The very base of every SharePoint List is its schema: the definition of Site Columns and Content Types which can be used to store your data. just like when working with databases, it can be challenging to modify the schema once it has been deployed, especially if the List contains some content.

When developing custom SharePoint Lists one way to find out if everything works as planned is to fill the List with test data and run some tests. although it might be tempting to fill in fields with random data depending on their type, it might be better to spend some more time and provide real-life information instead. this might not only help you discover some edge cases about your solution but it is also more intuitive to end users shoshould you want to gather their feedback as well.

The challenge with filling lists with real-life data during the development process is that there are no generators that understand your business and your scenario. so you can either create one yourself, which can get very time consuming, or fill in the data every time you modify the List schema and create a new build, which is also far from desirable. there is however yet another option...

In the perfect world

Wouldn't it be great if you cocould enter the test data once, store them separately from your List's schema and then reapply the data over and over again during the whole development process doing nothing more than minor changes to the data so that it fits the new schema? If that's what you want, Mavention Import List Instance might be just the right solution for you.

Introducting

Mavention Import List Instance is an extension for the Visual Studio 2010 SharePoint Developer Tools that allows you to import List Instances and their data into your SharePoint Project. after importing the List Instance to your project you can include it in one of your Features and create your List prefilled with test data with a single mouse click!

How it works

As an example I 've created a custom List that contains names of all Mavens. although in this case I created the List manually, it doesn' t really matter how you wocould create that List as long as it's there.

After installing Mavention Import List Instance a new menu item is added to every List node in the Server Explorer.

After clicking the menu item, the extension will import the selected List to your SharePoint Project as a List Instance SharePoint Project Item (SPI ).

Important:For the Import operation to work, you have to have a SharePoint Project open and active in Visual Studio.

As you can see, the Mavention Import List Instance extension includes des all field values in the imported List Instance SPI. to keep your test data clean and manageable it might be a good idea to remove all the unnecessary fields suchCreated,Author, Etc. Values of most of those fields cannot be imported anyway and are generated automatically by SharePoint.

Tip:Removing unnecessary fields can be doable if you have only a few rows but can quickly become a tedious process. in my next article I will show you how you can remove unwanted fields from the exported List Instance using XSLT and Visual Studio.

The only thing left for you to do now is to add the imported List Instance SPI to a Feature and the next time you will deploy your Solution and activate that Feature your List will be filled with some sample data.

The great part is that this approach works with new lists as well as existing lists.

Download: Mavention Import List Instance from Visual Studio Gallery.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.