Replies: 1 comment
-
@DinCR : below are snippets copied from a test case: // Step 1: ensure the list supports folders
var listTitle = "MyList";
var list = await context.Web.Lists.AddAsync(listTitle, ListTemplateType.GenericList);
await list.EnsurePropertiesAsync(l => l.RootFolder);
list.ContentTypesEnabled = true;
list.EnableFolderCreation = true;
list.Update();
// Step2: create a folder named Test
var folderItem = await list.AddListFolderAsync("Test");
// Step3: add item into this folder. Notice that the second parameter in the AddAsync method is the folder path
var item = await list.Items.AddAsync(new Dictionary<string, object> { { "Title", "blabla" } }, "Test"); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
May I know how I could create list items inside a folder in a SharePoint list using PnP Core. Thanks
Beta Was this translation helpful? Give feedback.
All reactions