AnnA Containers Structure
AnnA Containers should be one of these types:
- Message
- ButtonLink
- Time
- Multimedia
- ExecFunction
- Question
- Alternative
With the new Web Service V3, you will have the following structure:
Message container
Sends a message to the user
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | MESSAGE | Type of the container | Yes | |
Alias | Message123 | Use it to identify the container after the WebService node runs, e.g., Message123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
Phrase | Hello AnnA! | Text that will be sent to the user | Yes |
ButtonLink container
Sends a message that contains a button with an embed link
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | MESSAGE | Type of the container | Yes | |
Alias | Message123 | Use it to identify the container after the WebService node runs, e.g., Message123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
Phrase | Hello AnnA! | Text that will be sent to the user | Yes | |
PhraseHeader | Header text that will be sent to the user. | No | ||
PhraseFooter | Footer text that will be sent to the user. | Yes | ||
ButtonLinkText | Text that will be shown on the button to the user. | Yes | ||
ButtonLinkURL | URL that will open when the user clicks on the button. | Yes |
Time container
Wait some time before proceeding with the containers execution
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | TIME | Type of the container | Yes | |
Alias | Time123 | Use it to identify the container after the WebService node runs, e.g., Time123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
ShowMessage | Whether a message should be displayed or not. | S | No | |
Message | The text that will be sent to the user, e.g., Hello World! | Wait @@TimeToWait@@s | No | |
TimeToWait | 5 | Sets the time in seconds to pause the execution. | 0 | S |
Multimedia container
Sends media to the user, e.g. images, videos, audios, and documents.
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | MULTIMEDIA | Type of the container | Yes | |
Alias | Media123 | Use it to identify the container after the WebService node runs, e.g., Media123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
Phrase | The text that will be sent to the user, e.g., Hello World! | No | ||
MediaURL | The download URL for a file, e.g., https://your.domain/route/to/file.extension | Yes |
ExecFunction container
Executes one or more AnnA Functions
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | EXECFUNCTION | Type of the container | Yes | |
Alias | ExecFunc123 | Use it to identify the container after the WebService node runs, e.g., ExecFunc123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
Expression | AddParm(Teste1,123) AddParm(Teste,456) | Write expressions with AnnA Functions here, e.g., AddParm(Test1,123) AddParm(Test,456) | Yes |
Question container
Sends a question to the user
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | QUESTION | Type of the container | Yes | |
Alias | Question123 | Use it to identify the container after the WebService node runs, e.g., Question123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
Phrase | The question that will be sent to the user | Yes | ||
Competence | A competence already registered in the company. A new competence will be created if it does not exist in the company. | No | ||
Subject | A subject already registered in the company. A new subject will be created if it does not exist in the company. | No | ||
Topic | A topic within the subject. It will be created if it does not exist. | No | ||
IgnoreExecFluxo | Ignores other actions from the user aside from answering the actual question or ending all services. Can be “S” or “N” | N | No | |
SensitiveData | Pass ‘S’ to encrypt the answer using the company encryption key. Note that when retrieving the answer using AnnA Functions it will be encrypted as well. | N | No | |
RightAnswer | Enable this resource if you want to check if the answer is in the possible answers array | N | No | |
RightAnswerValue | The points that will be earned by the user if he answers correctly | No | ||
AnswerType | ’N’ if you don’t want to send feedback about the answer. ‘Q’ if you want to send feedback. | N | No | |
CorrectAnswerComment | When answerType is ‘Q’ then use this config to send a positive feedback to the user | No | ||
IncorrectAnswerComment | When answerType is ‘Q’ then use this config to send a negative feedback to the user | No | ||
DynamicValidations | Write expressions using AnnA Functions that returns TRUE or FALSE. The execution will continue when the expression returns TRUE | No | ||
ValidationError | Set a message for validation errors when dynamicValidations returns FALSE | No | ||
ValidationMask | Set a mask for the user answer | No | ||
ExternalData | It can store any information that you may want to retrieve with AnnA Functions, e.g., “LastAnswerJSON()” or “AnswersJSON()“ | No | ||
PossibleAnswers | If “rightAnswer” is set to “S” then this property should be provided. A collection of strings containing the possible right answers to the question | No |
Possible Answers
This structure should be just a collection of PropName and PropValue with “Alias” and “Value”:
Suppose the question is “1 + 1 = ?“. The possible answers would be:
Alternative container
Sends a multiple-choice question to the user.
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Type | ALTERNATIVE | Type of the container | Yes | |
Alias | Alternative123 | Use it to identify the container after the WebService node runs, e.g., Alternative123. | No | |
RestrictToGroup | Restrict the container execution per user group | No | ||
BeforeExecutionRule | Should be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should run | No | ||
Phrase | The question that will be sent to the user | Yes | ||
Competence | A competence already registered in the company. A new competence will be created if it does not exist in the company. | No | ||
Subject | A subject already registered in the company. A new subject will be created if it does not exist in the company. | No | ||
Topic | A topic within the subject. It will be created if it does not exist. | No | ||
Enumeration | Set the enumeration of the alternatives. N = Numbers, L = Letters, R = Roman, I = List (WhatsApp Popup), B = Buttons (WhatsApp Buttons) | N | No | |
Randomize | Pass ‘S’ to shuffle the alternatives. Defaults to ‘N’ | N | No | |
RightAnswer | Enable this resource if you want to check if the answer is in the possible answers array | N | No | |
AnswerType | ’N’ if you don’t want to send feedback about the answer. ‘Q’ if you want to send feedback. Defaults to ‘N’ | N | No | |
AnswerTypeComment | The message that will be sent when the user answers the question | No | ||
ExternalData | It can store any information that you may want to retrieve with AnnA Functions, e.g., “LastAnswerJSON()” or “AnswersJSON()“ | No | ||
Alternatives | Array that contains the alternatives | Yes |
Alternatives
This structure is similar to the root of the container, you have a collection of PropName and PropValue where PropName will be “Alternative+Sequence” and PropValue will be a PropJSON
First, the structure of an alternative:
PropName | PropValue | Description | Default | Required |
---|---|---|---|---|
Alias | Alias of the alternative, can be used to identify the user answer in subsequent nodes | No | ||
RestrictToGroup | Fill in the aliases of user groups that are registered within the company. | No | ||
ExhibitionRule | Use AnnA Functions to write an expression that returns TRUE or FALSE. If the expression returns TRUE then the container will be executed. | No | ||
Phrase | Text of the alternative | Yes | ||
IsCorrectAnswer | Only available when the “rightAnswer” option is set to ‘S’. Use ‘S’ to mark the alternative as correct answer. | No | ||
AlternativeValue | A value to the alternatives that will be used in statistics. | No | ||
Order | Order of the alternative. | No | ||
Comment | Message that will be sent to the user after he select the alternative | No |
Code example: