Save Form Design

Introduction

This API request is used to create a new form or make changes to an existing form.

Implementation tip: use GetFormDefinition to pull down the existing form structure if you are building a similar form.

This request’s JSON format varies for different type of forms and several types of fields. Aggregate field types and repeated fields with non-unique shortnames are not supported.

Getting Started

All API requests require an authorization token – reference our Authentication page for more information

API Structure

POST api/integration/SaveFormDesign

Required Request Parameters – All Forms

NameLocationValue OptionsDescription
Authorization tokenHeaderSee Login Authentication API documentation
OperationBody"Insert","Update"Indicate if the API request is to create or update an existing Form.
PartialSuccessBody"True", "False"Flag used when updating an existing form
RequestNoBodyRecommended unique for each request, visible within the UI for troubleshooting.
FormIDBodyLeave blank on new form creationGUID that can be used in other API requests.
FormNameBodyRequiredName of form that will be visible within the UI
TypeBodyType : Form Type
• 0 : Check
• 1 : Audit
• 2 : Questionnaire
See the Form Definition Page for information on when to use the different Form Types.
Each Form Type corresponds to a numerical value - the numerical value is passed in the API request
VersionBodyNew form: "0.1"
Existing form: current value.
Version numbers are incremented automatically for existing forms, all new forms start at version 0.1
Resource IDBody""GUID exposed in GetResources API response, value is optional.
Resource NameBodyThe name of the Resource within the UI.
Field InformationBodySee Below Table – will vary by Form Type and Field type.

Field Information Parameters – Check Type Form

The table below outlines the different role each value used within the different field types plays.

NameRequiredValue OptionsDescription
TypeRequiredType : Field Type
• 15 : Identifier
• 5 : Text
• 6 : Paragraph
• 7 : Select One
• 8 : Select Multiple
• 9 : Numeric
• 10 : Date
• 11 : Time
• 12 : Date & Time
Field types are used to format how the user will provide their answer to a field – a free text entry, picking one or more options from a drop down etc.

Each field type corresponds to a numerical value - the numerical value is passed in the API request.
ShowMinMaxConditionally Required"True"," False"Used only on Numeric fields, makes the ranges set for Min and Max visible to the user.
ShowTargetConditionally Required"True"," False"Used only on Numeric fields, makes the target value set visible to the user.
IsIntegratedConditionally Required"True"," False"Used only for Numeric fields enabled with BlueTherm hardware.
DependencyRuleRequirednullCovered in Advanced API Integration Technical Specification Document.
ExpressionRuleRequirednullCovered in Advanced API Integration Technical Specification Document.
FailsFormRequired"True"," False"Indicates if a non-compliant value should result in the entire form being marked as non-compliant.
AllowCorrectionRequired"True"," False"Covered in Advanced Form Integration API Technical Specification Document.
PredefinedCorrectionsConditionally RequirednullCovered in Advanced Form Integration API Technical Specification Document.
ShowIsResolvedConditionally Required"True"," False"Setting to enable a flag within the UI to show on non-compliant answers.
ConfigurationRequiredNullFunctionality not in use, must be set to null.
IsCompliantConditionally RequirednullCovered in Form Compliance API Integration Technical Specification Document.
DefaultComplianceConditionally RequirednullCovered in Form Compliance API Integration Technical Specification Document.
StepperTypeIDConditionally RequiredID : StepperType
• ebc1926c-17ad-4c96-bfd4-a1c0f4bb404b : Numeric
• b476a878-10b7-45df-ad25-9272f19a0074 : Standard
• 4f21287f-19cc-4399-a1fd-2544fa1f5ef9 : Tally Optimized
Used only on Numeric fields.
StepperTypeNameConditionally Required"Numeric", "Standard", "Tally Optimized"Set to Numeric for only collecting number entries, other options are for tally +/- functionality.
ElementTypeRequired0Used for internal purpose, set to zero.
IsRequiredRequired"True"," False"Flag to indicate if field is required to be completed by user before submission.
AllowCommentsConditionally Required"True"," False"Optional flag to allow user to enter additional comments. Default is False.
CommentConditionally RequirednullValue will be entered by user, always set to null. Must include if AllowComments is set to true.
AllowAttachmentsConditionally Required"True"," False"Flag to allow user to attach pictures or files to the field. Default is false.
AttachmentsConditionally RequirednullValue will be entered by user, always set to null. Must include if AllowAttchments is set to true.
ShowOnCOAOptional"True"," False"Flag that can be used for your own purposes for flagging data.
ShowHintConditionally Required"True"," False"Flag to reveal additional instructions or reminders to the User for that specific field. Default is False.
HintOptional"Sample text value"Include text only if ShowHint is set to True.
RepeatConditionally RequiredOnly available with numeric fields.
GroupIDRequired"00000000-0000-0000-0000-000000000000"Suggested default GUID provided in Options column.
ShowFieldRequired"True"," False"Dictate per Resource if the field should be visible to the Resource.
FieldBankIDOptional"00000000-0000-0000-0000-000000000000"Suggested default GUID provided in Options column. Functionality not in use.
ParentIDRequirednullWhile designing form, value will always be null.
ValueRequirednullWhile designing form, value will always be null.
DefaultConditionally RequiredOnly include a value when selection should be predetermined for user, otherwise set to null.
IDRequired"00000000-0000-0000-0000-000000000000"Suggested default GUID provided in Options column.
NameRequiredUI Name of field that will be visible to the user
ShortnameRequiredInternal UI Name that will be used in other parts of form building or API calls. Must be unique.
ShowPointsPossibleConditionally RequirednullMust be set to null on type Check Form.
ShowPointsEarnedConditionally RequirednullMust be set to null on type Check Form.
QuestionWeightConditionally RequirednullMust be set to null on type Check Form.

Field Information Parameters – Audit Form Type

NameRequiredValue OptionsDescription
ShowPointsPossibleRequired"True"," False"Show or hide the points possible that can be earned to the user
ShowPointsEarnedRequired"True"," False"Show or hide the points earned to the user.
QuestionWeightRequiredInteger valueThe overall points allowed for a question, must be whole numbers no decimals.

Check Form Type Request JSON

{
  "Operation": "Insert",
  "PartialSuccess": "false",
  "RequestNo": "Request Example 01",
  "Data": [
        {
            "FormId": "",
            "FormName": "Micro-Environmental Sanitation Check",
            "Type": 0,
            "Version": "0.1",
            "Resources": [
                {
                    "Id": "",
                    "Name": "Equipment > E1 > Metal Detector Line"
                }
            ],
            "Fields": [
                {
                    "Type": 9,
                    "ShowMinMax": true,
                    "ShowTarget": false,
                    "IsIntegrated": false,
                    "DependencyRule": null,
                    "ExpressionRule": null,
                    "FailsForm": true,
                    "AllowCorrection": false,
                    "PredefinedCorrections": null,
                    "ShowIsResolved": false,
                    "Configuration": null,
                    "IsCompliant": null,
                    "DefaultCompliance": null,
                    "StepperTypeId": "ebc1926c-17ad-4c96-bfd4-a1c0f4bb404b",
                    "StepperTypeName": "Numeric",
                    "ElementType": 0,
                    "IsRequired": true,
                    "AllowComments": false,
                    "Comment": null,
                    "AllowAttachments": false,
                    "Attachments": null,
                    "ShowOnCOA": true,
                    "ShowHint": false,
                    "Hint": null,
                    "ShowPointsPossible": null,
                    "ShowPointsEarned": null,
                    "QuestionWeight": null,
                    "Order": 0,
                    "Repeat": null,
                    "GroupID": "00000000-0000-0000-0000-000000000000",
                    "ShowField": true,
                    "FieldBankId": "00000000-0000-0000-0000-000000000000",
                    "ParentId": null,
                    "Value": null,
                    "Default": null,
                    "Id": "00000000-0000-0000-0000-000000000000",
                    "Name": "ATP Reading",
                    "ShortName": "ATP Reading"
                },
                {
                    "Type": 8,
                    "ControlType": 0,
                    "Options": [
                        {
                            "Value": null,
                            "Id": "00000000-0000-0000-0000-000000000000",
                            "Name": "Metal Detector"
                        },
                        {
                            "Value": null,
                            "Id": "00000000-0000-0000-0000-000000000000",
                            "Name": "Conveyor Belt"
                        },
                        {
                            "Value": null,
                            "Id": "00000000-0000-0000-0000-000000000000",
                            "Name": "Conveyor Belt Buckets"
                        }
                    ],
                    "DependencyRule": null,
                    "ExpressionRule": null,
                    "FailsForm": true,
                    "AllowCorrection": false,
                    "PredefinedCorrections": null,
                    "ShowIsResolved": false,
                    "Configuration": null,
                    "IsCompliant": null,
                    "DefaultCompliance": null,
                    "ElementType": 0,
                    "IsRequired": true,
                    "AllowComments": false,
                    "Comment": null,
                    "AllowAttachments": false,
                    "Attachments": null,
                    "ShowOnCOA": true,
                    "ShowHint": false,
                    "Hint": null,
                    "ShowPointsPossible": false,
                    "ShowPointsEarned": false,
                    "QuestionWeight": 0,
                    "Order": 0,
                    "Repeat": null,
                    "GroupID": "00000000-0000-0000-0000-000000000000",
                    "ShowField": true,
                    "FieldBankId": "00000000-0000-0000-0000-000000000000",
                    "ParentId": null,
                    "Value": null,
                    "Default": null,
                    "Id": "00000000-0000-0000-0000-000000000000",
                    "Name": "Surfaces Swabbed",
                    "ShortName": "Surfaces Swabbed"
                }
            ]
        }
    ]
}

Response Parameters


NameDescription
RequestIDUse this GUID within our GetBatchStatus API to request updates on when the request will be processed outside of the UI. See Request Status API documentation for more information on GetBatchStatus.
RequestStatusIf no syntax errors are present the default response is Pending until the request can be processed.
RequestErrorError object providing information if an error occurs
StatusIndicating the success of the API request

Response JSON

{
    "RequestId": "774c16bd-2e03-4f8a-97ab-004cb940b800",
    "RequestStatus": "Inprocess",
    "RequestError": [
        {
            "ErrorCode": 0,
            "FieldName": null,
            "FieldValues": null,
            "ErrorMessage": "",
            "Header": null
        }
    ],
    "Status": true,
    "Errors": null,
    "RefreshToken": false
}