Store Content in IDOL Server > Process Data before you Index > Use Lua Script Index Tasks > Find the Name of a Field

Find the Name of a Field
The function getFieldName returns the name of a field when you pass in a field object. For example, you can use it to search for a field using a wildcard value, or use this function in combination with fieldGetParent to return the name of a parent field.
for ii,field in ipairs { document:findField(“METADATA/*”) } do
local fieldname = document:fieldGetName(field)
This example loops through all children of the METADATA field and processes them according to the name of the child fields.
local parentname = document:fieldGetName(
This example finds the name of the parent field of the FIELDNAME field.