Adding multiple ListItem problem
See original GitHub issueCategory
- Bug
Describe the bug
I have a foreach cycle to define and upload multiple ListItem in a SharePoint List. The items are created inside some subfolders. (but I also tried in the root of the library) The first Item is correctly created, all the next items are not created and no error or exception is rised.
Steps to reproduce
IList list = await ctx.Web.Lists.GetByIdAsync(new Guid(config.Value.ListIdSessioniFormative));
foreach (var session in edition.sessions)
{
Dictionary<string, object> data = new Dictionary<string, object>()
{
{ "Title", edition.editionCode },
// various metadata
};
IListItem item = list.Items.Add(data, $"{folderCompany}/{folderYear}");
}
Expected behavior
A number of item equal to the foreach round should be created.
Environment details (development & target environment)
- SDK version: [1.2.0 ]
- OS: [Windows 10]
- SDK used in: [ASP.Net Web app]
- Framework: [.NET Core v3.1 ]
- Browser(s): [Chrome v90]
- Tooling: [Visual Studio 2019]
- Additional details:
Additional context
DELETE THIS LINE BEFORE SUBMITTING - Provide any other context about the problem.
Thanks for your contribution! Sharing is caring.
Issue Analytics
- State:
- Created 2 years ago
- Comments:21 (15 by maintainers)
Top Results From Across the Web
Error: Multiple ListItem elements defined on page
We are using itemListElement. This page includes details of 65 boarding schools, but the issue is that whenever I am trying to add...
Read more >Adding ListItems causes an error "Cannot have multiple ...
I am getting an error message "Cannot have multiple items selected in a DropDownList." After searching SO and google, I have narrowed the...
Read more >Unable to make more than one list item per list
Unable to make more than one list item per list · 1. insert list block as usual · 2. write “First” at the...
Read more >Unable to make more than one list item per list - page 2
When creating a list we cannot create more than one list item at each level. ... One question, do I keep 'core/list' and...
Read more >List not working! When adding item it saves then creates ...
List not working ! When adding item it saves then creates multiple duplicates of same item. Hi Everyone! We have an issue with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Micael-stack : with tomorrow’s PnP PS build you should see an exception being thrown for this (as PnP PS was still using an old PnP Core library). Good that you’ve found the failing field…maybe create a PR for the PowerShell docs to clarify this?
@jansenbe If your static and internal dont match, it is because you got into two possibilities : the internal name was already used within the site, or, the length was too long. Static name is not unique and internal should always be prefered if we want perfect match…