Access row value in template_preprocess_views_view_fields(&$variables) In template_preprocess_views_view_fields(&amp;$variables), when I print $variables['row'], I get the following object.



How can I access values inside the node entity?

I tried with the following code, but it is not working.

$variables['row']-&gt;_entity-&gt;values['field_file_pdf_upload']-&gt;target_id
values is protected, so you have to use the get() method:

$variables['row']-&gt;_entity-&gt;get('field_file_pdf_upload')-&gt;target_id;


For the field object this shortcut is available (this is not standard OOP and works for fields only):

$variables['row']-&gt;_entity-&gt;field_file_pdf_upload-&gt;target_id;