Calculated Strip query on enum

Thu 7. Sep 2017, 16:57

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
blankdud
 
Posts: 1
Joined: Thu 7. Sep 2017, 16:46

Re: Calculated Strip query on enum

Wed 13. Sep 2017, 16:27

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
User avatar
[Articy] Peter Sabath
Articy Staff
Articy Staff
 
Posts: 89
Joined: Wed 23. Nov 2011, 13:58
Location: Bochum

Return to Technical Discussion

Who is online

Users browsing this forum: No registered users and 19 guests

Who We Are
Contact Us
Social Links