Articy Forum


https://www.articy.com:443/forum/

Calculated Strip query on enum

https://www.articy.com:443/forum/viewtopic.php?f=33&t=18257

Page 1 of 1

Calculated Strip query on enum

Posted: Thu 7. Sep 2017, 16:57
by blankdud
I am trying to get a list of entities where the value of an enum is equal to the technical name or display name of the entity it is attached to.

For example:
Entity1 has a calculated strip that wants to get a list of entities where the value of the "WhatEntity" enum is equal to "Entity1".

Is it possible to make this happen? From the documentation it seems I need to supply the enum index value or the enum technical name, but there is no way to convert my DisplayName to that.


What I want:
Self = Entity1

SELECT *
FROM Entities
WHERE Entity.WhatEntity = DisplayName <- Errors

Re: Calculated Strip query on enum

Posted: Wed 13. Sep 2017, 16:27
by [Articy] Peter Sabath
Hi blankdud,

unfortunately that is not possible.

Enum values are numbers, even if it is possible to use their technical names in queries.
"Self" is always an object reference and can only be compared to other object references.
So the query detects a data type inconsistency and reports that as error.

Have you thought about using "Slot" property in your feature and restricting it to only Entities of a given template.
Using that you can easily compare a "Self" reference to such a Slot and can also restrict valid entries in the Slot without manually changing the enumeration.

-Peter

All times are UTC
Page 1 of 1