Skip to main content

Filtering Using a List of Elements for Tags

Can I filter by a list of values in the URL for tags (e.g. "tags in (1, 2, 3)")?

Written by Petr Pech

Filtering records by tags is possible, but not using an enumeration of values. ABRA Flexi cannot handle syntax like stitky in (1, 2, 3) — it will fail with a 500 error indicating a syntax error in the database query.


Solution using OR

Instead of an enumeration, use the logical operator or and list each tag separately:

GET /c/{firma}/adresar/(stitky='code:VIP' or stitky='code:DULEZITE').xml

A single tag is filtered the same way, just without or:

GET /c/{firma}/adresar/(stitky='code:DULEZITE').xml

ℹ️ Tags are stored on the record as a text property stitky, so filtering is done using the value code: with the tag's abbreviation. The list of existing tags is returned by the stitek record.

💡 Don't forget to encode the filter — spaces around or should be encoded as %20. Details on writing filters are summarized in the article Filtering Records.


Related

Did this answer your question?