Getting Started > Use Lua Scripts > Method Reference > Change the Value of a Field

Change the Value of a Field
The functions getFieldValue, fieldGetValue and setFieldValue, fieldSetValue allow you to modify the contents of a field directly.
For example:
local content_field = document:findField("CONTENT")
local content = document:fieldGetValue(content_field)
local content = document:getFieldValue("CONTENT")
content = content .. "\nCopyright MyCorp\n"
document:setFieldValue("CONTENT", content)
document:fieldSetValue(content_field, content)