Example on how to use a custom function to access field