Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Folder is getting created with ID number

$
0
0

Dear Team,

I am creating a Folder in SharePoint List using rest API. I have followed along the below URL and was able to create a folder.

https://info.paitgroup.com/blog/sharepoint-rest-api-and-lists-with-folders

Now the Problem is the folder is getting created with ID_000 format. 



Following is the code I have used.

return $.ajax({
                url: requestUri,
                type: "POST",
                contentType: "application/json;odata=verbose",
                data: JSON.stringify({"__metadata": { type: "SP.Data." + listname + "ListItem" },
                    Title: folderName,
                    FileLeafRef: folderName,
                    FileRef: folderName,    // No effect here
                    FileSystemObjectType: SP.FileSystemObjectType.folder,
                    ContentTypeId: "0x0120"
                }),
                headers: {"accept": "application/json;odata=verbose","X-RequestDigest": data.d.GetContextWebInformation.FormDigestValue
                }
            });

Let me know if you need any more info.

Thanks,

Pavan.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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