Skip to main content

Batch editing records using a filter

Is it possible to bulk edit records using a filter?

Written by Petr Pech

A bulk change can be made with a single import — instead of an identifier, the record specifies the filter attribute, and Flexi applies the change to all matching records.


Writing

<winstrom version="1.0">
<faktura-vydana filter="id between 490 492">
<varSym>11111111111</varSym>
</faktura-vydana>
</winstrom>

The response statistics show how many records were affected by the change — <updated>2</updated>. The filter cannot be specified in the URL; it must be an attribute of the record element.

⚠️ Characters with special meaning must be written as entities in the attribute — &lt; instead of <, otherwise the import will fail with a parser error. This is described in the article Error: The value of attribute "filter".


Document Items

Document items cannot be edited this way — the item record does not allow import, and the request will fail with an error:

Import není povolen.

An item must therefore be changed via its document: specify the document identifier and, within it, the item identifier.

<winstrom version="1.0">
<faktura-vydana>
<id>123</id>
<polozkyDokladu>
<faktura-vydana-polozka>
<id>456</id>
<nazev>Nový název</nazev>
</faktura-vydana-polozka>
</polozkyDokladu>
</faktura-vydana>
</winstrom>

💡 Actions can be triggered in bulk the same way — for example, <faktura-vydana action="lock" filter="…"> locks all matching documents. See Locking Documents via API.


Related

Did this answer your question?