Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Add Multiple Items batch only work for more than 4 items #392

@JackHu88

Description

@JackHu88

Category

[ ] Enhancement

[ x] Bug

[ ] Question

Expected / Desired Behavior / Question

I want to add multiple items to a list, but when items less than 4 then batch can't work.

Steps to Reproduce

Below code can't work, when i change the i large than 3, for example 4, then it can work.

var list = $pnp.sp.web.lists.getByTitle("BatchTest");

list.getListItemEntityTypeFullName().then(entityTypeFullName => {

    var batch = $pnp.sp.web.createBatch();

    for(i=0;i<3;i++){
	    list.items.inBatch(batch).add({ Title: "Batch"+i }, entityTypeFullName).then(b => {
            console.log(b);
        });
    }    
    batch.execute().then(d => console.log("Done"));
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions