How to insert values into Global custom text field of views programmatically? How can I programmatically insert values into Global custom text field from the views. I have tried using the $views variable from the hook_views_pre_render(&amp;$views) and my_theme_name_process_function(&amp;$vars) but was unsucessful in getting the value ?
When I try for a simple field I can insert html into the markup programmatically.

$view = view Object
(
    [db_table] =&gt; views_view
    [base_table] =&gt; node
    [base_field] =&gt; nid
    [name] =&gt;view_name
    [vid] =&gt; 3
    [description] =&gt; 
    [tag] =&gt; default
    [human_name] =&gt; view_name
    [core] =&gt; 7
    [api_version] =&gt; 
    [disabled] =&gt; 
    [editing] =&gt; 
    [args] =&gt; Array
    (
        )

    [use_ajax] =&gt; 
    [result] =&gt; Array

  [result] =&gt; Array
        (
            [0] =&gt; stdClass Object
                   [field_field_final_ort] =&gt; Array
                            (
                                [0] =&gt; Array
                                    (
                                        [rendered] =&gt; Array
                                            (
                                                     ['#markup'] =&gt; YES     


I want to similarly change the value of GLOBAL custom text field using views object but there is not such array for global custom text field. 
What is the way for changing it?

My code was 

function my_themename_process_views_view_field(&amp;$vars) {

  if ($vars['view']-&gt;name == 'view_name') {
foreach( $vars['view']-&gt;result as $key =&gt; $value) { 
$value-&gt;field_name[0]['rendered']['#markup'] = '';
}


}

I want to apply this similar code for global custom text field but there is no suxh available inside result array

How can I alter values for each row of global custom text field value ? 
The answer given below gives same values for each row .
You should be able to do that with hook_views_pre_render(). Please try the following code:

function YOUR_THEME_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;
  }
}


If the global custom text value need to be different for each view result, you can configure it using replacement patterns.



In order to programmatically insert values into Global custom text field, You can use template_preprocess_views_view_fields()

function YOUR_THEME_preprocess_views_view_fields(&amp;$vars) {
  $view = $vars['view'];

  foreach ($view-&gt;field as $id =&gt; $field) {

    // The global custom text content
    $vars['fields']['nothing']-&gt;content = 'Some global custom text content';

    // change the global custom text content depend on result (node id)
    if ($vars['row']-&gt;nid == 10) $vars['fields']['nothing']-&gt;content = 'CHANGED';
  }
}