Items queries

Guidelines

Creation of a new query

To create a new query, click on the button “Add an item query”.

You'll need to give it a name, and then decide whether you want to inherit it from an existing query or not. Once the query has been created, you are automatically redirected to its details.

Then, you will be able add filters to define the scope of items. There are 3 filters available on items features.

Features lang

This filter is used to select the language in which features are to be retrieved from items. The project's default language will be applied by default but it can be overridden. This filter is mandatory if one of the other two filters is selected, so it will be added on its own.

Only indexed languages appear in the drop-down list. If you can't find the desired lang, please refer to your Onestock contact to have it indexed on your project.

Features value

This filter is used to check the exact value of one or more features on items. For example, to filter on all items with the "active_sfs" feature set to true or to 1.

Only indexed features appear in the drop-down list. If you can't find the desired feature, please refer to your Onestock contact to have it indexed on your project.

Only existing values appear in the selection. If you can't find the desired value, please create at least one item with this value.

Features comparison

This filter is used to compare one or more item features according to a numerical value. For example, to filter on all items with the "price" feature worth more than 50.

Only indexed numerical features appear in the drop-down list. If you can't find the desired feature, please refer to your Onestock contact to have it indexed as a numerical feature on your project.

Onestock advices

We advise you to use inheritance to build your queries.

For example, you could start by creating an "items" query, specifying only the language used for your features. If called, this query will return all items. This basic query can be used for orchestration stock queries if you don't restrict your items in specific cases.

Then, you can define the features primarily used for stock exports to the website. In the example below, we've created the items_sfs and items_ckc queries which filter respectively on "active_sfs" and "active_ckc" features. The item request tree would look like this:

You can then create new filters on other features if you need them.