What hook to alter the result of a view? In a custom module, I have a custom entity for which a view shows the following values:



Contact is the ID of another entity (Person) containing some fields, such as Email. Adresse courriel is a Custom text field defined in the view.  

What hook should I use to achieve the following task?


Query the Person entity with the Contact value to retrieve the Email field value
Update Adresse courriel in the view output
1- Firstly you need to add a relationship to the Person entity to have the fields available.

2- then use hook_views_query_alter() to change the fields values.