Skip to content

Get Field

To retrieve the current value of a form field.

Parameter

Parameterstypedescription
fieldIdStringUnique Id of the field.

Syntax

kf.context.getField(fieldId).then((res) => {...})

or

let value = await kf.context.getField(fieldId);

Returns

Returns the value of the field, and the data type varies based on the field type.

Example

To obtain the value of the rating field from your employee data form, use the field ID of the ratings field, ratingField, and retrieve the value.

In this example, the data type of the returned value would be integer.

let value = await kf.context.getField(ratingField);

Output

3