Skip to main content

Batch Operations

Updating multiple records at once

Written by Lenka Haringerová

During import, a single element can be used to update multiple records at once. For example, the following adds the label VIP to all price list items with the supplier FIRMA:

<?xml version="1.0"?><winstrom version="1.0">  <cenik filter="dodavatel = 'code:FIRMA'">    <stitky>VIP</stitky>  </cenik></winstrom>

The attribute filter specifies the records from the given agenda (here cenik) on which the operation will be performed. The filter language is the same as in the REST API.

Batch processing works as if, instead of a single cenik element with the attribute filter, individual cenik elements were provided for all records matching the given condition. The only difference is that during batch operations, id elements are ignored entirely.

You can also use JSON format to specify a batch operation:

{    "winstrom": {        "@version": "1.0",        "faktura-vydana": {            "@filter": "stitky='code:OVERENO'",            "@action": "lock"        }    }}

This example would trigger the action lock on all records in the faktura-vydana agenda that have the label OVERENO assigned.

Did this answer your question?