Deprecated Context API

Context functions that have been deprecated and will be fully removed in a future SDK release

KeyTypeDescription

getFieldValues

function

Fetch all of the form and hidden field values of the current user.

setFieldValues

function

Pass in an object of the shape {<fieldId>: <fieldValue>} to update the user's form field and hidden field values.

setFieldOptions

{[fieldKey:string]: (string[] | { value: string; label ?: string; image ?: string }[])} => {}

Dynamically update the available options for fields that support a list of options (radio groups, checkbox groups, dropdowns, dropdown multiselects, button groups, text fields). Either pass in an array of new values, or for more granular control over stored values and rendered images & labels, you can pass in an array of objects.

setFieldErrors

({ [fieldId: string]: string | { message: string, index: number } } }) => void

Pass in an object of the shape {<fieldId>: <fieldErrorString>} to set errors for specific fields. An entry with the shape {<fieldId>: {message: <fieldErrorString>, index: <fieldIndex>}} will set an error for a specific repeatable field across its repetitions. Setting an error prevents the step from submitting.

getFormFields

() => fieldData

Returns information for all fields in the form.

fieldData Definition

The object keys are unique field IDs, defined in the Feathery dashboard. They map to objects that store additional field-specific information, defined below.

KeyTypeDescription

displayText

optional string

Text to display to your user along with the field

type

string enum

Field type (e.g. textarea, checkbox, etc.)

value

optional polymorphic

User-submitted value for this field. null if no submission, Promise<File> if file submission, Base64 string if signature, array of values if repeated.

options

{value: string, label?: string}[]

Allowed options to choose from, if the field specifies them (e.g. dropdown, radio buttons, etc.)

fieldData example

{
  age: {
    displayText: 'How old are you?',
    type: 'integer_field',
    value: 21 
  },
  photo_id: {
    displayText: 'Upload a photo of your ID',
    type: 'rich_file_upload',
    value: Promise<File>
  }
}

Last updated