Showing results for 
Search instead for 
Did you mean: 

Issue in inserting Multiple Records in a single API request using CAP


I have been using using CAP for exposing my HANA tables to ODATA. I can perform CRUD operations from the following documentation With the documentation I can insert single record. For example inserting a book we can use the below API request,

POST serviceName/Books
data: {
  ID: 121,
  title: 'Jane Eyre',
  author_ID: 12

with the schema.cds

entity Books {
  key ID : Integer;
      title : string(20);

and service.cds

using {sap.capire.bookshop as my} from '../db/schema';

service ServiceName @(requires : 'admin') {
  entity Books   as projection on my.Books;

But to insert multiple books in the form of array in a single request as below,

POST serviceName/Books
data: [{
  ID: 121,
  title: 'Book A'
  ID: 122,
  title: 'Book B'

How can we achieve the multiple record insertion in a single request as above

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos


You can't just pass an array to create multiple records, you have to use batch requests: