Get field should do that too
Here is the documentation.
/* Parameters
----------------------------------------------- */
# $docid [ int ]
# ID of the document for which to get a field content.
# Default: current document
$gfIntDocId = (isset($docid)) ? $docid : $modx->documentIdentifier;
# $field [ string ]
# Name of the field for which to get the content:
# - any of the document object fields (
http://modxcms.com/the-document-object.html)
# - template variable
# Default: ’pagetitle’
$gfStrDocField = (isset($field)) ? trim($field) : ’pagetitle’;
# $parent [ 0 | 1 ]
# If set to 1, the snippet will return value for the document parent.
# Default: 0
$gfBoolParent = (isset($parent)) ? $parent : 0;
# $parentLevel [ int ]
# Specifies how high in the document tree to search for the parent of the document:
# - $parentLevel = 0 - returns the ultimate parent (right under site root)
# - $parentLevel = 1 - returns the direct parent
# Default: 0
$gfIntParentLevel = (isset($parentLevel) && is_int((int) $parentLevel)) ? $parentLevel : 0;
# $topid [ int ]
# Id of the topmost document in the document tree under which to search for a parent. Used only with $parent set to 1.
# Default: 0
$gfIntTopDocId = (isset($topid) && is_int((int) $topid)) ? $topid : 0;
/* Do not edit the code below!
----------------------------------------------- */