<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Okay, no answers for the question. <br>
</p>
<p>For future reference (if others have the same problem and find
this posting) : <br>
</p>
<p>You can use an array constructor together with the array_get
function <br>
</p>
<p>i.e., if you have an Enum processing input "animals" with values
like "Gorilla","Snake" and "Elephant", you can get the enum
textual value by using this construct: </p>
<p><font face="monospace"><b>array_get(array('Gorilla','Snake','Elephant'),@animals)</b><br>
</font><br>
It's not pretty - but it much shorter than writing a potentially
humongous CASE..WHEN construct.<br>
An even better method would be to use a (hypothetical) function
that returns a list of enumeration texts based on the name of the
input, like </p>
<p><font face="monospace"><b>array_get(enum_texts('animals'),@animals)
</b></font>or - even better -<font face="monospace"><b> </b></font><font
face="monospace"><b>enum_text('animals',</b></font><font
face="monospace"><b>@animals</b></font><font face="monospace"><b>)</b></font></p>
<p>However, i haven't found these hypothetical functions.<br>
<font face="monospace"> </font><br>
</p>
<pre class="moz-signature" cols="72">Med venlig hilsen / Best regards
Bo Victor Thomsen</pre>
<div class="moz-cite-prefix">On 10/06/2025 12.35, Bo Victor Thomsen
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0e67893f-c77c-4021-9af2-d576056fd5a9@gmail.com">Hi list
-
<br>
<br>
I'm designing a processing model, where i use a "Enum" input. When
accessing this variable in a "Calculate Expression" algorithm in
the model, the result will be an ordinal value - not a text - from
the enum.
<br>
<br>
Example:
<br>
I have an enum named "animal" defined with 3 animal names like
"Gorilla","Snake","Elephant". If the user choose "Snake" the
variable @animal contains the number "1" instead of "Snake". How
do I get the textual representation of the enum instead of the
ordinal ?
<br>
<br>
I'm aware I can use a CASE... WHEN in the expression. But it will
be cumbersome for enums with many values.
<br>
<br>
</blockquote>
</body>
</html>