Skip to main content

API

API provides access to the form methods and utility functions _. It's passed as a param to every onEvent call (see Events) and let's you to read and change payload data. You can also access through the getApi() method from Form if you keep a reference to the object.

api.additionalData.get​

api.additionalData.get(path?: string) => any

Given a path, gets a value from the additionalData property.
e.g. api.additionalData.get("user.name")

api.formValid​

api.formValid() => boolean

Returns true when all the validations in the form components are ok, and false in any other case. e.g. api.formValid()

api.payload.get​

api.payload.get(path?: string) => any

Given a path, gets a value from the Payload data.
e.g. api.payload.get("user.name")

api.payload.set​

api.payload.set(path: string, value: Payload) => any

Given a path, gets a value in the Payload data.
e.g. api.payload.set("user.profile", {name: "Tom", age: "22"})

api.lang.get​

api.lang.get() => string

Gets language key from current state.
e.g. api.lang.get()

api.lang.set​

api.lang.set(lang: string) => void

Given string key, sets up as new lang in current state.
e.g. api.lang.set("en_us")

api.uploadFiles​

api.uploadFiles(nextPayload?: Payload, autoupload?: boolean) => void

Starts the upload of attached files. When autoupload is passed as true, only the files inside an upload component whose autoupload property is set to true will be uploaded. e.g. api.uploadFiles()

api._​

api._

It provide the Flowable Forms underscore lib. See section Utilities Library _.
e.g. api._.futch(any_url)