Namespace: Manage

Appearition.Form.Manage

Use the functions under this module to create, change and remove Form records on the Appearition platform

Methods

Appearition.Form.Manage.AddFormToGroup (request, requestOptions) static

Will link an existing form to an existing group. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormSummaryViewModel

Contains the details of the form and group

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.CreateForm (request, requestOptions)number static

Will create a new Form record and return the system allocated unique identifier (Id or FormId).

Name Type Description
request Appearition.Form.Manage.FormCreateViewModel

Contains the details of the Form

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
number The system allocated FormId will be returned for the newly created Form. This is returned as part of the success callback function in the requestOptions param

Appearition.Form.Manage.CreateFormGroup (request, requestOptions)number static

Will create a new group record and return the system allocated unique identifier (Id or FormGroupId).

Name Type Description
request Appearition.Form.Manage.FormGroupSummaryViewModel

Contains the details of the group

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
number The system allocated FormId will be returned for the newly created Form. This is returned as part of the success callback function in the requestOptions param

Appearition.Form.Manage.DeleteForm (request, requestOptions) static

Will delete an existing Form record. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormViewModel

Contains the details of the Form

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.DeleteFormGroup (request, requestOptions) static

Will delete an existing group record. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormGroupSummaryViewModel

Contains the details of the Form

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.GetForm (formId, requestOptions)Appearition.Form.Manage.FormViewModel static

This method will return the details of a specific form

Name Type Description
formId number

Uniquely identifies the form

requestOptions Appearition.RequestOptions

configure callbacks

Returns:
Type Description
Appearition.Form.Manage.FormViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Form.Manage.Index (requestOptions)Appearition.Form.Manage.FormIndexViewModel static

This method will return various data for setting up the index page of a Form management UI. It will fetch and return all form records in the database. It will return a Appearition.Form.Manage.FormIndexViewModel object

Name Type Description
requestOptions Appearition.RequestOptions

configure callbacks

Returns:
Type Description
Appearition.Form.Manage.FormIndexViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Form.Manage.RemoveFormFromGroup (request, requestOptions) static

Will unlink an existing form from an existing group. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormSummaryViewModel

Contains the details of the form and group

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.UpdateForm (request, requestOptions) static

Will update the details of an existing Form record. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormViewModel

Contains the details of the Form

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.UpdateFormGroup (request, requestOptions) static

Will update the details of an existing group record. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormGroupSummaryViewModel

Contains the details of the Form

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.UpdateFormGroupOrdinals (request, requestOptions) static

Will save the rearrangement of group positions. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormIndexViewModel

Contains the list if groups with the ordinal positions changed

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Form.Manage.UpdateFormOrdinals (request, requestOptions) static

Will save the rearrangement of the form positions. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Form.Manage.FormGroupSummaryViewModel

Contains the list of forms in new order in the group

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Type Definitions

Appearition.Form.Manage.FormCreateViewModel

This is the data structure to use when submitting a create form request to the server

Properties:
Name Type Description
FormName string

The name of the Form. This is mandatory

IsWizardForm bool

If set to true, this will create the form and allocate it to the project (aka channel) and to the group as specified in FormGroupId property. If set to false, will create the form and not allocate it to any project nor group

FormGroupId number

Identifies the group that the new form is under. This is optional and should be set if the IsWizardForm property is set to true

Ordinal number

The index position within all the forms in the group that this specific form appears in. Zero based index.

Appearition.Form.Manage.FormFieldListItemViewModel

Represents a specific item in a list. This relates specifically to a field which is a list

Properties:
Name Type Description
Id number

Unique identifies the Field in the database

ItemText string

The text that is displayed in the list for selection

Ordinal number

The index position within the list that this specific option appears in. Zero based index.

IsDeleted boolean

Is required to be set by the client to indicate if the list item needs to be deleted from the field

IsNew boolean

Is required to be set by the client to indicate if a list item has been added to the field

Appearition.Form.Manage.FormFieldViewModel

Represents a specific field that appears on a form. A field is polymorphic in that it can be defined to represent a text field, a list field or anything else required.

Properties:
Name Type Description
Id number

Unique identifies the Field in the database

FieldType Appearition.Form.FieldTypeEnum

Identifies the face that this field must take (e.g. Text, List, Photo, etc). Note whilst this is a fixed enum, more types can be added in the future.

FieldTypeName string

The text value of the FieldType

FieldLabel string

Text that is presented to the user as a prompt to the field

Instructions string

Text that is presented to the user as guidance when setting a value for the field

SubFormId number

Deprecated

RepeatSubFormCount number

Deprecated

Ordinal number

The index position within the form that this specific field appears in. Zero based index.

IsDeleted boolean

Is required to be set by the client to indicate if a field needs to be deleted from the form

IsNew boolean

Is required to be set by the client to indicate if a field has been added to the form

ListItems Array.<Appearition.Form.Manage.FormFieldListItemViewModel>

A collection of values that the user can choose from. This is only applicable if the field type is a list

Appearition.Form.Manage.FormGroupSummaryViewModel

Represents a group and all of the details

Properties:
Name Type Description
Id number

Unique identifies the group

FormGroupName string

The name of the group

FormGroupNameOriginal string

Can be used to handle rollback actions on the UI when editing

Ordinal number

The index position within all the forms that this specific form appears in. Zero based index.

OrdinalOriginal number

Can be used to handle rollback actions on the UI when editing.

IsJobAllocated boolean

If set to true, a user will not be able to complete and submit any forms unless they have chosen an allocated job. If set to false, the user is able to complete and submit forms for any site and any job.

IsJobAllocatedOriginal boolean

Can be used to handle rollback actions on the UI when editing

ProjectForms Array.<Appearition.Form.FormSummaryViewModel>

The collection of forms associated with this group

IsEdit boolean

Deprecated. Can be used in a client UI to control editing

IsSelected boolean

Deprecated. Can be used in a client UI to control selection

IsReorderForms boolean

Deprecated. Can be used in a client UI to control re ordering of groups

Appearition.Form.Manage.FormIndexViewModel

This data structure holds the details of all Forms synchronised from server to client

Properties:
Name Type Description
AllProjectForms Array.<Appearition.Form.Manage.FormSummaryViewModel>

A collection of Form records

FormGroups Array.<Appearition.Form.Manage.FormGroupSummaryViewModel>

A collection of Groups which have forms associated under

OtherForms Array.<Appearition.Form.Manage.FormSummaryViewModel>

A collection of Forms which exist in the database but are not allocated to the same project (aka channel)

NewForm Appearition.Form.Manage.FormCreateViewModel

Can be used with a UI when creating a new Form record.

NewFormGroup Appearition.Form.Manage.FormGroupSummaryViewModel

Can be used with a UI when creating a new group of forms record.

IsReorderFormGroups boolean

Deprecated. Only useful for client side UI

Appearition.Form.Manage.FormSummaryViewModel

Represents a Form and all of the details

Properties:
Name Type Description
FormId number

Unique identifies the Form

FormGroupId number

Unique identifies the group which this form is under

IsRequired boolean

Indicates if this form must be filled in and at least saved before proceeding to the next.

OriginalIsRequired boolean

Can be used to handle rollback actions on the UI when editing

FormName string

The name of the Form

Instructions string

Text that is presented to the user as guidance when completing and submitting the form

Ordinal number

The index position within all the forms that this specific form appears in. Zero based index.

OrdinalOriginal number

Can be used to handle rollback actions on the UI when editing

Appearition.Form.Manage.FormViewModel

Represents a Form and all of the details

Properties:
Name Type Description
Id number

Unique identifies the Form

FormName string

The name of the Form

Instructions string

Text that is presented to the user as guidance when completing and submitting the form

Ordinal number

The index position within all the forms that this specific form appears in. Zero based index.

DefaultPdfTemplateName string

The selected template that will be used to generate a report when a form has been completed and submitted to the server

Fields Array.<Appearition.Form.Manage.FormFieldViewModel>

The list of fields that is presented on the form

FieldTypeList Array.<Appearition.SelectListItem>

The list of field types that can be added to a form. This can be used during create/edit of a form.

SubFormList Array.<Appearition.SelectListItem>

Deprecated. A list of "other forms" that can be added to a form. This can be used during create/edit of a form.

PdfTemplates Array.<Appearition.SelectListItem>

A collection of templates that can be used to generate a custom formatted report for submissions of a form