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_fields is required.
  • options may only be set on fields whose type is InputType.SELECT.

Attributes #

AttributeTypeDescriptionRequired
form_fieldslist[FormField]List of fields.Yes

FormField #

AttributeTypeDescription
keystrUnique identifier of the field; the appointment metadata key.
labelstrThe label displayed on the field.
typeInputTypeThe type of the input: TEXT, SELECT, or DATE. Defaults to TEXT.
requiredboolWhether the input is required. Defaults to False.
editableboolWhether the input can be edited. Defaults to True.
optionslist[str]Possible options when the input type is SELECT. Only allowed on SELECT fields.
valuestrDefault 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()