General

Insert Bulk Data From a File

Changed on

Inserts multiple records to the Master Data table from the CSV file.<p>

The /loaddata operation is a very efficient and quick way to insert bulk data to the Master Data table. The main advantage is its greater speed when loading thousands of records (compared to e.g. /integrate).<p>

If used in a Groovy logic, it is recommended to use the api.addOrUpdate() method instead of this loaddata endpoint within the boundCall().<br> For more details see the Avoid api.boundCall article.

<p> <!-- theme: warning -->

Please note If no joinFields are provided in the request, then this operation will insert entire records. It means that in this case (without joinFields) with /loaddata.file it is not possible to update just some fields (for this use the /integrate endpoint instead). The source data must always contain the entire row’s content.

post/loaddata.file/{TypeCode}

Request

Query parameters

namestring

The name of the table you want to upload a file to.

Request body multipart/form-data

fileNamestring binary required

Provide a file in the CSV format. The file must also contain the name column with the name(s) of the table (PX, CX, SX) you are inserting the records to.

joinFieldsstring

Specify fields that make up a Business key.

detectJoinFieldsboolean

Set to true to use the join fields definitions from the server instead of specifying them with the joinFields parameter.

replaceSoftDeletedboolean

Set to true to replace records that are soft deleted in the target table and match the business key, instead of restoring them. The whole record is replaced with the data from the file, so values of fields that are not present in the file are not restored. This option can be used only when the load runs with join fields, that is when joinFields is specified or detectJoinFields is set to true. Otherwise the request fails with a validation error.

syncOnTargetTableboolean

Set to true to acquire a distributed lock on the target table before the load starts, so that parallel loads into the same table wait for each other instead of running at the same time.

Response

OK

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property