Sharepoint 2013 REST API: create list view with listviewXML

%3CLINGO-SUB%20id%3D%22lingo-sub-198367%22%20slang%3D%22en-US%22%3ESharepoint%202013%20REST%20API%3A%20create%20list%20view%20with%20listviewXML%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-198367%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20create%20a%20view%20using%20the%20list%20view%20xml%20but%20it%20is%20not%20working.%20Anyone%20can%20give%20a%20example%20code%20that%20I%20can%20learn%20from%3F%3C%2FP%3E%3CP%3EHere%20is%20the%20code%20I%20tried%3A%3C%2FP%3E%3CP%3E%22ListViewXml%22%3A%20%22%3CVIEW%20name%3D%22%5C%26quot%3B%7B30C488EB-692E-4C8B-A70A-8D68AFDAF0B3%7D%5C%26quot%3B%22%20mobileview%3D%22%5C%26quot%3BTRUE%5C%26quot%3B%22%20type%3D%22%5C%26quot%3BHTML%5C%26quot%3B%22%20displayname%3D%22%5C%26quot%3Btest%5C%26quot%3B%22%20url%3D%22%5C%26quot%3B%2FLists%2Ffelixtest%2Ftest.aspx%5C%26quot%3B%22%20level%3D%22%5C%26quot%3B1%5C%26quot%3B%22%20baseviewid%3D%22%5C%26quot%3B1%5C%26quot%3B%22%20contenttypeid%3D%22%5C%26quot%3B0x%5C%26quot%3B%22%20imageurl%3D%22%5C%26quot%3B%2F_layouts%2F15%2Fimages%2Fgeneric.png%3Frev%3D44%5C%26quot%3B%22%3E%3CQUERY%3E%3CGROUPBY%20collapse%3D%22%5C%26quot%3BTRUE%5C%26quot%3B%22%20grouplimit%3D%22%5C%26quot%3B50%5C%26quot%3B%22%3E%3CFIELDREF%20name%3D%22%5C%26quot%3BTitle%5C%26quot%3B%22%3E%3C%2FFIELDREF%3E%3CFIELDREF%20name%3D%22%5C%26quot%3BAppAuthor%5C%26quot%3B%22%20ascending%3D%22%5C%26quot%3BFALSE%5C%26quot%3B%22%3E%3C%2FFIELDREF%3E%3C%2FGROUPBY%3E%3CORDERBY%3E%3CFIELDREF%20name%3D%22%5C%26quot%3BID%5C%26quot%3B%22%3E%3C%2FFIELDREF%3E%3C%2FORDERBY%3E%3C%2FQUERY%3E%3CVIEWFIELDS%3E%3CFIELDREF%20name%3D%22%5C%26quot%3BLinkTitle%5C%26quot%3B%22%3E%3C%2FFIELDREF%3E%3C%2FVIEWFIELDS%3E%3CROWLIMIT%20paged%3D%22%5C%26quot%3BTRUE%5C%26quot%3B%22%3E40%3C%2FROWLIMIT%3E%3CAGGREGATIONS%20value%3D%22%5C%26quot%3BOff%5C%26quot%3B%22%3E%3C%2FAGGREGATIONS%3E%3CVIEWSTYLE%20id%3D%22%5C%26quot%3B13%5C%26quot%3B%22%3E%3C%2FVIEWSTYLE%3E%3CJSLINK%3Eclienttemplates.js%3C%2FJSLINK%3E%3CXSLLINK%20default%3D%22%5C%26quot%3BTRUE%5C%26quot%3B%22%3Emain.xsl%3C%2FXSLLINK%3E%3CTOOLBAR%20type%3D%22%5C%26quot%3BStandard%5C%26quot%3B%2F%22%3E%3C%2FTOOLBAR%3E%22%3C%2FVIEW%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Established Member

Hi All,

 

I want to create a view using the list view xml but it is not working. Anyone can give a example code that I can learn from?

Here is the code I tried:

"ListViewXml": "<View Name=\"{30C488EB-692E-4C8B-A70A-8D68AFDAF0B3}\" MobileView=\"TRUE\" Type=\"HTML\" DisplayName=\"test\" Url=\"/Lists/felixtest/test.aspx\" Level=\"1\" BaseViewID=\"1\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/generic.png?rev=44\" ><Query><GroupBy Collapse=\"TRUE\" GroupLimit=\"50\"><FieldRef Name=\"Title\" /><FieldRef Name=\"AppAuthor\" Ascending=\"FALSE\" /></GroupBy><OrderBy><FieldRef Name=\"ID\" /></OrderBy></Query><ViewFields><FieldRef Name=\"LinkTitle\" /></ViewFields><RowLimit Paged=\"TRUE\">40</RowLimit><Aggregations Value=\"Off\" /><ViewStyle ID=\"13\" /><JSLink>clienttemplates.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><Toolbar Type=\"Standard\"/></View>"

0 Replies