Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Create list from template

If you call GetList, you can find out what the template GUID for that list is. For instance, then I call GetList on the foo list I created in the code I posted in your other thread, I see that ServerTemplate="100".
$().SPServices({
  operation: "GetList",
  listName: "foo"
});
<List DocTemplateUrl="" DefaultViewUrl="/Intranet/JQueryLib/Lists/foo/AllItems.aspx" MobileDefaultViewUrl="" ID="{C4590827-385E-4D55-B4E8-04F94236416E}" Title="foo" Description="List created for quiz: foo" ImageUrl="/_layouts/images/itgen.gif" Name="{C4590827-385E-4D55-B4E8-04F94236416E}" BaseType="0" FeatureId="00bfea71-de22-43b2-a848-c05709900100" ServerTemplate="100" Created="20130211 02:11:53" Modified="20130211 02:13:27" LastDeleted="20130211 02:11:53" Version="2" Direction="none" ThumbnailSize="" WebImageWidth="" WebImageHeight="" Flags="545263616" ItemCount="0" AnonymousPermMask="0" RootFolder="/Intranet/JQueryLib/Lists/foo" ReadSecurity="1" WriteSecurity="1" Author="3" EventSinkAssembly="" EventSinkClass="" EventSinkData="" EmailInsertsFolder="" EmailAlias="" WebFullUrl="/Intranet/JQueryLib" WebId="42f65d3f-343d-4627-a9a3-abf3d4d6491f" SendToLocation="" ScopeId="7c8593fb-90e4-4a2b-9e22-6ad48b082312" MajorVersionLimit="0" MajorWithMinorVersionsLimit="0" WorkFlowId="" HasUniqueScopes="False" AllowDeletion="True" AllowMultiResponses="False" EnableAttachments="True" EnableModeration="False" EnableVersioning="False" Hidden="False" MultipleDataList="False" Ordered="False" ShowUser="True" EnableMinorVersion="False" RequireCheckout="False">
I would suggest creating a list with all of the columns you want and then running GetList to obtain the XML. You could save that XML in a list as a document and read from it to create future lists.

M.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>