So a basic question. On Drupal 8 I have a views field override using preprocess. I need to get the value of the field but everything I try returns null or an error. I have:
function mytheme_preprocess_views_view_field(&$variables) {
$view = $variables['view'];
$id = $view->storage->id();
if ($id == "myfield"){
$myfieldvalue = $variables['field'];
}
}
I have tried various combinations. I thought getValue() might work but no. So far $variables['field']->original_value is closest but obviously returns the markup version.
The $variables I cannot see the raw value. So question is how do I get it? Do I need to load the node and get it that way?