GetFieldByName
Gets field by it's name.
Syntax
expression.GetFieldByName();
expression - A variable that represents a ApiDocument class.
Parameters
This method doesn't have any parameters.
Returns
Example
Get field by name in document.
// How can I get the field by name using a document in a PDF document?
// Get the field by name for a document in a PDF document.
let doc = Api.GetDocument();
let page = doc.GetPage(0);
let textField = Api.CreateTextField([10, 10, 160, 30]);
page.AddObject(textField);
textField.SetName('Text field 1');
textField = doc.GetFieldByName('Text field 1');
textField.SetValue('Example value');