How to alter single custom field value in views? I have a view with field Global: Custom Text, which is modified as a link.
I want to change replacement tokens for generating this link, dependent on a value of other field.

Tried to modify this in hook_views_pre_render but I can't find a way to do this.

In hook_views_post_render there are two arrays:

$view-&gt;style_plugin-&gt;render_tokens
$view-&gt;style_plugin-&gt;row_tokens


which contains generated links for every row, but they are not present in pre_render, and changing them in post_render doesn't work.

I've also tried to do that in template_preprocess_views_view_fields but for that specific view this function does not firing (for other views it does), and I don't know why.
function hook_views_pre_render(&amp;$view) {

  switch ($view-&gt;name) {
    case 'YOUR_VIEW_NAME':
      //  override the global custom text field value
      $view-&gt;field['nothing']-&gt;options['alter']['text'] = 'My custom text';
    break;
  }
}


Check the link for more details
How to insert values into Global custom text field of views programmatically?

add nid as field in view and use that field for condition
you can add condition as follows: if ($nid == '124') {  $view-&gt;field['nothing']-&gt;options['alter']['text'] = $nid}

Simple way is to create a new field field_waga which will have field_waga_1 as new name if you check in the view and then you can change the label and override that field with your custom value

if($view-&gt;result[0]-&gt;field_waga[0]['raw']['value'] == '10') {
//here you can create the field to act as custom text field and enter the custom //value
$view-&gt;result[0]-&gt;field_waga_1[0]['#markup'] = 'alter';
}