How to add a field to Views table output with hook_views_pre_render? I have a view displaying node titles formatted as a table. In a custom module I'm using hook_views_pre_execute to do do a table join and add a field to the views query. (I cannot use a regular relationship in Views to accomplish the join, because it has to be a RIGHT JOIN).

When I inspect the resulting view object with dpm($view) in hook_views_pre_render, I can see that the objects in $view-&gt;result contain the string values of the node_title, nid, and field_myfield_value (where field_myfield_value is added via the custom module).

But how do I actually display field_myfield_value in the view? And more specifically, how do I make it a column of the table?
To take a different approach: you could add the field through the UI as normal, and use hook_views_query_alter() to change the join type:

function MYMODULE views_query_alter(&amp;$view, &amp;$query) {
  if ($view-&gt;name == 'my_view' &amp;&amp; $view-&gt;current_display == 'foo') {
    $query-&gt;table_queue['field_data_field_myfield']['join']-&gt;type = 'RIGHT';
  }
}


That should get you the same effect with a bit less effort.