<div dir="ltr"><div>On which QGIS version are you?</div><div><br></div><div>I made this ticket a few weeks ago. You will see that the enum will give its index and not the string as you can think.</div><div><a href="https://github.com/qgis/QGIS/issues/32452">https://github.com/qgis/QGIS/issues/32452</a></div><div><br></div><div>Nyall did some PR in 3.11.</div><div><br></div><div>You need to use a CASE WHEN in your expression. You can open Nyall's model to check.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 13 déc. 2019 à 12:25, Richard Duivenvoorde <<a href="mailto:rdmailings@duif.net">rdmailings@duif.net</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Just received a question from a user:<br>
<br>
He has a small processing model and wants to use an 'enum' (text) input<br>
in the model as value for a new column. Which in the column  is created<br>
by the 'field calculator' algorithm.<br>
<br>
But we cannot find out how to get the 'chosen' value out of the<br>
'enum'-input (which are always 'strings'). Whatever we try the value of<br>
the new column records are always NULL<br>
<br>
To reproduce:<br>
- create an fresh model with an input vector layer<br>
- create in 'enum' input call it 'choice' with 2 values 'blue', 'red'<br>
- use the 'field calculator' algorithm to create a new string field<br>
we thought that '@choice' would be the Formula (being the value of the<br>
'choice' input...<br>
<br>
BUT: the column is never filled with 'red' or 'blue'...<br>
<br>
Anybody a clue?<br>
<br>
Regards,<br>
<br>
Richard Duivenvoorde<br>
<br>
ps looking into<br>
<a href="https://qgis.org/api/classQgsProcessingParameterEnum.html#details" rel="noreferrer" target="_blank">https://qgis.org/api/classQgsProcessingParameterEnum.html#details</a><br>
and<br>
<a href="https://qgis.org/api/qgsprocessingparameters_8cpp_source.html" rel="noreferrer" target="_blank">https://qgis.org/api/qgsprocessingparameters_8cpp_source.html</a><br>
dit not reveal anything to me...<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>