cancel
Showing results for 
Search instead for 
Did you mean: 

xsOdata Multiple Data insert is not working

former_member594414
Participant
0 Kudos

Hi All,

I have a requirement where I'm passing multiple rows as JSON from UI to xsodata for performing multiple insert operations. It happens like this UI -> xsodata -> xsjslib -> procedure

The problem here is, I'm not able to insert the multiple row data from UI as I get 'null' oData values

"https://cg06layishrb117a-project-folder-project-ui.s1h1red.com:30033/test.xsodata/AdjMaxVersion('null')"

Below is the response oData

{
"ID" : null,
"NAME" :null,
"EMAIL"	:null,
"PHONE_NUMBER" :null,
}

Below is the payload i'm passing

{
"ID" : 1,
"NAME" :"ar",
"EMAIL"	:"test",
"PHONE_NUMBER" :"1111",
},
{
"ID" : 2,
"NAME" :"eln",
"EMAIL"	:"test",
"PHONE_NUMBER" :"2222",
},

The xsjslib and procedure code are working independently, but the problem is while calling the service from UI, the data is not getting inserted in the tables and I get the NULL return data

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

1st: You do not need the "('null')" at the end of the endpoint. Adressing the right entity set for the POST is enough.

2nd: You are taking about a procedure, you are meaning a write exit procedure you are using to override the standard insert logic? Can you show your logic for that.

3rd: I is not possible to insert multiple records with one standard POST. Either you have to use single POSTs or you have to use a batch request which bundles the single POSTs. The UI5 OData V2 model supports that already out of the box.

former_member594414
Participant
0 Kudos

Thanks Florian. Got the missing link:)

Answers (0)