The getValueByPath method gets the value of a sub-field, specified by path. If you pass this method the path of a sub-field that has multiple values, only the first value is returned. To return all of the values from a multi-value sub-field, see getValuesByPath.


getValueByPath( path )


Argument Description
path (string) The path of the sub-field.


(String). A string containing the value.


Consider the following document:

      <anothersubfield>the value to return</anothersubfield>

The following example demonstrates how to retrieve the value "the value to return" from the sub-field anothersubfield, using a LuaField object representing A_FIELD:

local field = document:getField("A_FIELD")
local value = field:getValueByPath("subfield/anothersubfield")

© 2014 Hewlett-Packard Development Company, L.P.