Skip to main content

subscribeToForm

Subscribe to a form event by marker. 🔐 This method requires .

Description​

This method subscribes the current user to a form event identified by its marker, for a specific form data record. It returns a Promise that resolves to true if the subscription was successful, or an IError object if there was an issue.

⚠️ With the default errors.isShell: true setting, a rejected request is returned rather than thrown: this method resolves to an IError object, never to false. Check result === true - an error object is truthy, so if (result) would treat a failure as success.

.subscribeToForm(

,

);

Parameters schema​

Schema

marker(required): string
Event marker
example: "form_marker"

body(required): ISubscribeFormEvent
Subscription body. Example: { formDataId: 123 }

body.formDataId(required): number
Form data identifier.
example: 123

body.status: string
Optional subscription status.

Examples​

Minimal example​

const response = await Events.subscribeToForm('form_marker', { formDataId: 123 });

Example response​

true

Response schema​

Schema: boolean

boolean: boolean
Returns true if the subscription was successful.
example: true