Appointment Metadata Create form
This allows developers to dynamically display additional fields when scheduling an appointment. For more guidance, see the “How to add additional fields to the scheduling appointment fields” guide.
Build an AppointmentsMetadataCreateFormEffect with the form fields to show, then return its apply() from an APPOINTMENT__FORM__GET_ADDITIONAL_FIELDS handler.
Methods #
apply() → Effect #
Displays the form fields on the appointment form.
form_fieldsis required.optionsmay only be set on fields whosetypeisInputType.SELECT.
Attributes #
| Attribute | Type | Description | Required |
|---|---|---|---|
form_fields | list[FormField] | List of fields. | Yes |
FormField #
| Attribute | Type | Description |
|---|---|---|
key | str | Unique identifier of the field; the appointment metadata key. |
label | str | The label displayed on the field. |
type | InputType | The type of the input: TEXT, SELECT, or DATE. Defaults to TEXT. |
required | bool | Whether the input is required. Defaults to False. |
editable | bool | Whether the input can be edited. Defaults to True. |
options | list[str] | Possible options when the input type is SELECT. Only allowed on SELECT fields. |
value | str | Default value for the field. |
Example #
from canvas_sdk.effects.appointments_metadata import (
FormField,
InputType,
AppointmentsMetadataCreateFormEffect,
)
AppointmentsMetadataCreateFormEffect(form_fields=[
FormField(
key='status',
label='Status',
type=InputType.SELECT,
required=False,
editable=True,
options=["open", "close"],
value=""
),
]).apply()