Calculated Strip

Just like normal strips calculated strips can contain a series of links to other articy objects. This strip type however will be automatically filled by articy:draft by executing a user-defined 'query'.

To learn how to write queries, please download ArticyDraft - Query Language.pdf.

You can add a calculated reference strip to a feature in the same way as all other basic property types: Just drag and drop it from the basic properties list 1 to the layout area in the middle.



When adding a calculated strip, the query editor dialog is opened automatically. In this dialog you can define and test the query for the strip. The upper textbox is used to write the query. If you need help with the syntax, please read the ArticyDraft - Query Language.pdf.

If you use the keyword "Self", the query editor will display this error: "Query uses the 'SELF' context object, but no object was supplied". This does not mean that your query is wrong. It simply cannot be evaluated as long as no context 2 is provided for the query check.

A click on "Check query" 3 will evaluate the query. A list of all objects that matched the query will be displayed underneath.



To accelerate the search for query results, it's recommended to narrow down the area in which the search works. Click on the "Search in:"-dropdown and choose a folder. For example: If you know that all objects you are looking for are entities, you should only search in the entities system folder.



You can also define multiple sorting criteria as well as the way results are grouped. In some cases it can also be useful to set a limit - e.g., so that the calculated strip only contains the first 50 results.
If you want to edit a query later, just click on the "edit query"-button 4 in the parameter column on the right of the feature editor.



Example: Finding all recipes that need a specific ingredient

The following basic example should give you a good idea for what calculated reference strips can be used. Let's imagine you want to create a game with a crafting system.

You have two entity templates: "recipe" and "ingredient". The "recipe"-template contains multiple reference slots for "ingredient"-objects.

To keep a good overview, ingredients should display all recipes in which they can be used. To achieve this without the need of adding every recipe manually, you can add a calculated reference strip to the "ingredient"-template.

The query for the calculated strip could look like this:
Recipe.Ingredient_01 == Self OR Recipe.Ingredient_02 == SELF OR Recipe.Ingredient_03 == SELF

The result is a reference strip in the property sheet of all ingredients that automatically lists all recipes, in which this specific ingredient is used. For example, the ingredient "Strawberries" is used in the recipes for a stawberry pie and a fruit smoothie: