Improvement in spo listitem add #3031
Replies: 2 comments 2 replies
-
Could you share some more information how to reproduce this? Is the matching field in the list required or not? I wonder if there are cases where you might want us to pass empty values through and if this changes wouldn't lead to a breaking behavior. |
Beta Was this translation helpful? Give feedback.
-
What happens now is that if I have an array with objects that has the following output ; Title : Finished task
Bucket : New Bucket
Progress : In progress
Priority :
Description :
StartDate : 04/02/2022 10:00:00
DueDate : 05/02/2022 10:00:00
Checklist :
AssignedTo : [{'Key':'i:0#.f|membership|[email protected]'},{'Key':'i:0#.f|membership|[email protected]'}]
Title : Test task
Bucket : New Bucket
Progress : Completed
Priority :
Description :
StartDate :
DueDate :
Checklist :
AssignedTo : And would run the a foreach on that object exuecting this:
The result would be: Processing (1/2)
Processing (2/2)
Error: Item does not exist. It may have been deleted by another user. Removing the fields that are empty from adding will fix the issue and the item will be created. None of the columns specified are currently marked as required. It seems to be happening with the datetime fields; the text fields and choice fields can handle an empty value. |
Beta Was this translation helpful? Give feedback.
-
Encountered while building #3013. When passing empty values in
spo listitem add
(null values or empty strings) the response when adding an item isError: Item does not exist. It may have been deleted by another user.
I suggest we add logic to exclude empty values before adding an item to prevent this (for a me a weird error); that way writing scripts becomes easier (sometimes you want to create a bunch of new items when migrating something ;-)). We should implement this in
private mapRequestBody(options: Options)
.@pnp/cli-for-microsoft-365-maintainers do you feel the same?
Beta Was this translation helpful? Give feedback.
All reactions