I have a view grid that has custom actions to perform based on selected grid row. To read the view fields from the grid dpm-ed the below command:


The above command returns:

enter image description here

I am trying to specifically read the "field_comment_id_comment_field_data_nid" and I get null every time:


Update: I modified the dpm and I see the value correctly. Unsure of how to loop through the result array. still trying.

  • ResultRow doesn’t have a get method. The output says field_comment_id_comment_field_data_nid is a public property of the object so you can access it directly
    – Clive
    Nov 30, 2021 at 17:53
  • I tried the below code: dpm($this->view->result->field_comment_id_comment_field_data_nid->Value) to read the value directly and I get null
    – chaydru
    Nov 30, 2021 at 17:58
  • 1
    You need to pay a bit more attention to the debug output - $this->view->result is an array
    – Clive
    Nov 30, 2021 at 18:19
  • can i get some more help? I'm still seeing null on my end :( newbie here..
    – chaydru
    Nov 30, 2021 at 19:10

1 Answer 1


Alright. Below solution works:

foreach($this->view->result as $result)

thanks @clive for pointing on the array thing.

Not the answer you're looking for? Browse other questions tagged or ask your own question.