# Field Object

`Field` objects are the primary mechanism for accessing and manipulating field data and properties. They can be accessed via the [Context API](https://docs.feathery.io/develop/context-api).

<table><thead><tr><th width="220" align="center">Field Property</th><th align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td align="center"><code>value</code></td><td align="center"><code>optional polymorphic: boolean | string | string[] | number | number[] | Promise | Promise[] | Record&#x3C;string, any></code></td><td><p>Read/write property for getting or setting the field value. The type of the value varies depending upon the field type. </p><p></p><p>The value is an array type for multi-valued field types (e.g. multi select, etc.) or if the field is repeating.  </p><p></p><p><code>null</code> if no submission, <code>Promise&#x3C;File></code> if file submission, Base64 <code>string</code> if signature.</p></td></tr><tr><td align="center"><code>required</code></td><td align="center"><code>boolean</code></td><td>If the field must be filled out before submitting. Read/write property.</td></tr><tr><td align="center"><code>disabled</code></td><td align="center"><code>boolean</code></td><td>If the field is disabled or interactable.<br>Read/write property.</td></tr><tr><td align="center"><code>options</code></td><td align="center"><code>string[] | { value: string; label ?: string; image ?: string }[]</code></td><td><p>Allowed options to choose from, if the field specifies them (e.g. dropdown, radio buttons, etc.).</p><p>Read/write property.</p></td></tr><tr><td align="center"><code>type</code></td><td align="center"><code>string enum</code></td><td><p>The field type (e.g. <code>textarea</code>, <code>checkbox</code>, etc.).  Only available for fields on the loaded form.</p><p>Read-only property.</p></td></tr><tr><td align="center"><code>displayText</code></td><td align="center"><code>optional string</code></td><td><p>The text to display to your user along with the field</p><p>Read-only property.</p></td></tr><tr><td align="center"><code>onThisForm</code></td><td align="center"><code>boolean</code></td><td><p>True if this field appears on the loaded form.  False if the field is from another form.</p><p>Read-only property.</p></td></tr><tr><td align="center"><code>isHiddenField</code></td><td align="center"><code>boolean</code></td><td><p>True if this field is one of the special 'hidden' fields that do not appear on a form.  False if this field is a regular form field.  </p><p>Read-only property.</p></td></tr><tr><td align="center"><code>placeholder</code></td><td align="center"><code>string</code></td><td><p>The placeholder text for the field that is shown when the field has no value.  </p><p>Read/write property.</p></td></tr><tr><td align="center"><code>setStyles()</code></td><td align="center"><code>(styles: Record&#x3C;string, any>) => void</code></td><td>Dynamically update the styles of a form field. <a href="field.setstyles">Style API Reference</a></td></tr><tr><td align="center"><code>setError()</code></td><td align="center"><code>(...error: string | {index:number; message: string}) => void</code></td><td><p>Method used to set the error of a field.  The error may be passed as text or as an object.</p><p>An error with the shape <code>{message: &#x3C;fieldErrorString>, index: &#x3C;fieldIndex>}}</code> will set an error for a specific repeatable field across its repetitions. Setting an error prevents the step from submitting.</p></td></tr><tr><td align="center"><code>equals()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field <strong>equals</strong> any of the values passed.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>notEquals()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field <em><strong>does not equal</strong></em> any of the values passed.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>greaterThan()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field is <strong>greater than</strong> any of the values passed.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>greaterThanOrEqual()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field is <strong>greater than or equal</strong> to any of the values passed.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>lessThan()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field is <strong>less than</strong> any of the values passed.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>lessThanOrEqual()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field is <strong>less than or equal</strong> to any of the values passed.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>isFilled()</code></td><td align="center"><code>() => boolean</code></td><td>Returns true if the field <strong>contains a value</strong> that was set by the user or by logic.  </td></tr><tr><td align="center"><code>isEmpty()</code></td><td align="center"><code>() => boolean</code></td><td>Returns true if the field <strong>does not contains a value,</strong> i.e. the field was not set by the user or by logic. </td></tr><tr><td align="center"><code>isTrue()</code></td><td align="center"><code>() => boolean</code></td><td>Returns true if the field is true or <a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy">truthy</a>.</td></tr><tr><td align="center"><code>isFalse()</code></td><td align="center"><code>() => boolean</code></td><td>Returns true if the field is true or <a href="https://developer.mozilla.org/en-US/docs/Glossary/Falsy">falsy</a>.</td></tr><tr><td align="center"><code>contains()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>contains</strong> the text of any of the values passed.  The text must match on upper/lower case exactly.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>doesNotContain()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>does not contain</strong> the text of any of the values passed.  The text must match on upper/lower case exactly.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>containsIgnoreCase()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>contains</strong> the text of any of the values passed.  The text comparison ignores upper/lower case differences and will match on different cases.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>doesNotContainIgnoreCase()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>does not contain</strong> the text of any of the values passed.  The text comparison ignores upper/lower case differences and will match on different cases.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>startsWith()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>starts with</strong> the text of any of the values passed.  The text must match on upper/lower case exactly.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>doesNotStartWith()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>does not start with</strong> the text of any of the values passed.  The text must match on upper/lower case exactly.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>endsWith()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>ends with</strong> the text of any of the values passed.  The text must match on upper/lower case exactly.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>doesNotEndWith()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Returns true if the field text <strong>does not end with</strong> the text of any of the values passed.  The text must match on upper/lower case exactly.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>isNumerical()</code></td><td align="center"><code>() => boolean</code></td><td>Returns true if the field value <strong>is a number</strong>. </td></tr><tr><td align="center"><code>isText()</code></td><td align="center"><code>() => boolean</code></td><td>Returns true if the field value <strong>is text and not a number</strong>. </td></tr><tr><td align="center"><code>selectionsInclude()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Used for multi-valued fields.  Returns true <strong>if any of the field's values exactly equal</strong> the text of any of the values passed as parameters.  A value may be a string or another Field.</td></tr><tr><td align="center"><code>selectionsDoNotInclude()</code></td><td align="center"><code>(...values: string | Field) => boolean</code></td><td>Used for multi-valued fields.  Returns true <strong>if none of the field's values exactly equal</strong> the text of any of the values passed as parameters.  A value may be a string or another Field.</td></tr></tbody></table>
