Saltar al contendio prinicipal

Submit Form-3.0.0

Send a Form to a Channel
key: PBSendSurvey

Overview

This parameterized bot automatically fills out forms and sends them to the channel of your preference.

Take note

This bot is not retro-compatible. Use the latest version for best results.

Special Inputs

Description of special parameters and formats for configuring the bot.

Required ObjectIds

Either of the following fields is required:

  • Survey ID field – surveyId: MongooseObjectId;

OR

note

Obtain ObjectIds from COTSurvey data model.


Either of the following fields is required:

OR

note

Obtain ObjectIds from COTChannel, COTTask, and COTTaskGroup, respectively.


Prefilled Format

The Prefilled field has a custom format, depending on the survey. The general format is { identifier-1: value-1, identifier-2: value-2 ... } .

For example, if a survey has two fields, a text-input ("name") and a number-input ("age"), the correct format would be:

prefilled: {
"name": "Trinidad",
"age": 1
}

Data Types per Question Type

Data types for prefilled surveys depend on the question type or survey component.

Survey Question TypeData Type
Text:(label) cannot be set
Listquestion:string[ ] (array of ON codes) e.g., [ "chile", "usa" ]
Textinput:string
Textnumber:number
Datetime:Date (Not yet implemented)
Property:string[ ] (array of codes) or ObejctId<COTProperty>[ ]
Person:string[ ] (array of emails) or ObejctId<COTUser>[] (NYI)
Calendar:Not yet implemented
GPS:Not yet implemented
Image:Not yet implemented
Signature:Not yet implemented
File:Not yet implemented
Api:Not yet implemented
SurveySurvey:Prefill[ ] // surveys-surveys are defined as as an array of objects. See example.

Survey-Survey Example

If the same survey "name" and "age" is used as a survey-survey, with the identifier user_records, this would create 3 survey-surveys, the first empty, the second with only the name, and the third with both name and age. |

{
"user_records":
[
{ },
{
"name": "Freddy"
},
{
"name": "Kurt",
"age": 27
}
]
}
note

For more information on question types see:


Inputs

1. Survey Id (key: surveyId)

Required: no
Data Type: CotSurveyId

2. Survey Code (key: surveyCode)

Required: no
Data Type: string

3. Channel Id (key: channelId)

Required: no
Data Type: CotChannelId

4. Task Id (key: taskId)

Required: no
Data Type: CotTaskId

5. Task Group Id (key: taskGroupId)

Required: true
Data Type: CotTaskGroupId

6. Sender Id (key: senderId)

Required: no
Data Type: CotUserId

7. Recipient Id (key: recipientId)

Required: true
Data Type: CotUserId

8. Edit Mode (key: editMode)

Required: no
Data Type: boolean

9. Prefilled (key: prefilled)

Required: no
Data Type: dictionary any

10. Meta (key: meta)

Required: no
Data Type: dictionary any

Next Stages

1. SUCCESS

2. ERROR

Outputs

1. Status (key: status)

Required: no
Data Type: boolean