<div dir="ltr"><div>Hi,</div><div>The @current_feature is, according to the doc[0], available when editing in attribute table and form contexts which are not actually the one you have, Matteo.</div><div><br></div><div>[0] <a href="https://github.com/qgis/QGIS/blob/master/src/core/expression/qgsexpression.cpp#L861and">https://github.com/qgis/QGIS/blob/master/src/core/expression/qgsexpression.cpp#L861and</a> in documentation <a href="https://docs.qgis.org/3.10/fr/docs/user_manual/working_with_vector/expression.html#variables">https://docs.qgis.org/3.10/fr/docs/user_manual/working_with_vector/expression.html#variables</a></div><div><br></div><div>Greetings,</div><div>Harrissou<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 8 juil. 2020 à 14:51, Andreas Neumann <<a href="mailto:a.neumann@carto.net">a.neumann@carto.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"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi Matteo,</p>
<p>The "$" prefix marks a function without arguments, "@" are variables. Sometimes both variants exist, as you have discovered. Mainly due to historic reasons and the fact that the "$"-stuff is around for a lont time already, but the variables where added quite a bit later.</p>
<p>Are you sure that "@current_feature" really exists? I can't find it in my expression builder (in layer scope).</p>
<p>You are probably aware that variables have different scopes (global, project, layer, layout, etc.) - some variables are only available in some scopes, because they wouldn't work in other scopes or it wouldn't make sense there.</p>
<p>Greetings,</p>
<p>Andreas</p>
<p id="gmail-m_4206045352561231901reply-intro">On 2020-07-08 14:03, matteo wrote:</p>
<blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px">
<div style="margin:0px;padding:0px;font-family:monospace">Hi all,<br><br>before to file a ticker I'd like to have a small feedback. Maybe I'm<br>missing something but what is actually the difference between<br>$currentfeature and @current_feature?<br><br>Because I was expecting to use @current_feature together with attribute<br>like:<br><br>attribute(@current_feature, 'my_field')<br><br>within the Default Value of a Field in the Attributes Form, but it<br>didn't work while<br><br>attribute($currentfeature, 'my_field')<br><br>works nice<br><br>If someone has a small explanation I will gladly add it to the documentation<br><br>Cheers and thanks for any hint<br><br>Matteo<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="noopener 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="noopener noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div>
</blockquote>
<p><br></p>

</div>
_______________________________________________<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>