odata_upsert_rows
Idempotent import of rows into any entity via OData: PATCH when the record exists (matched by keyFields), otherwise POST. Safe to re-run -- duplicates are updated, not re-created. Best for small-to-medium transactional loads (e.g. <= a few thousand rows). For bulk loads use dmf_import_file. Provide rows as a JSON array of objects; resolve key fields from the KB (get_data_entity_info) -- do not guess them.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"entitySet": "<entitySet>",
"rowsJson": "<rowsJson>",
"keyFields": "<keyFields>"
},
"name": "odata_upsert_rows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rowsJson | Yes | JSON array of row objects, e.g. [{"CustomerAccount":"C0001","Name":"Acme"}]. | |
| entitySet | Yes | OData public entity set name, e.g. 'CustomersV3'. | |
| keyFields | Yes | Comma-separated business key fields used to detect existing records, e.g. 'CustomerAccount' or 'dataAreaId,ItemNumber'. | |
| legalEntity | No | Optional legal entity (dataAreaId) injected into each row when absent. | |
| crossCompany | No | Set true to allow cross-company writes. |