Skip to content

AnnA Containers Structure

AnnA Containers should be one of these types:

  • Message
  • Time
  • Multimedia
  • ExecFunction
  • Question
  • Alternative

The containers will always have a PropName which represents the name of the option/property, and a PropValue that will be the value of the option/property

The first level of the structure will always be the “Container+sequence” with the value being the configuration of the container type:

[
{
"PropName": "Container001",
"PropValue": "..."
},
{
"PropName": "Container002",
"PropValue": "..."
}
]

Message container

Sends a message to the user

PropNamePropValueDescriptionDefaultRequired
TypeMESSAGEType of the containerYes
AliasMessage123Use it to identify the container after the WebService node runs, e.g., Message123.No
RestrictToGroupRestrict the container execution per user groupNo
BeforeExecutionRuleShould be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should runNo
PhraseHello AnnA!Text that will be sent to the userYes

Time container

Wait some time before proceeding with the containers execution

PropNamePropValueDescriptionDefaultRequired
TypeTIMEType of the containerYes
AliasTime123Use it to identify the container after the WebService node runs, e.g., Time123.No
RestrictToGroupRestrict the container execution per user groupNo
BeforeExecutionRuleShould be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should runNo
ShowMessageWhether a message should be displayed or not.SNo
MessageThe text that will be sent to the user, e.g., Hello World!Wait @@TimeToWait@@sNo
TimeToWait5Sets the time in seconds to pause the execution.0S

Multimedia container

Sends media to the user, e.g. images, videos, audios, and documents.

PropNamePropValueDescriptionDefaultRequired
TypeMULTIMEDIAType of the containerYes
AliasMedia123Use it to identify the container after the WebService node runs, e.g., Media123.No
RestrictToGroupRestrict the container execution per user groupNo
BeforeExecutionRuleShould be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should runNo
PhraseThe text that will be sent to the user, e.g., Hello World!No
MediaURLThe download URL for a file, e.g., https://your.domain/route/to/file.extensionYes

ExecFunction container

Executes one or more AnnA Functions

PropNamePropValueDescriptionDefaultRequired
TypeEXECFUNCTIONType of the containerYes
AliasExecFunc123Use it to identify the container after the WebService node runs, e.g., ExecFunc123.No
RestrictToGroupRestrict the container execution per user groupNo
BeforeExecutionRuleShould be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should runNo
ExpressionAddParm(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

PropNamePropValueDescriptionDefaultRequired
TypeQUESTIONType of the containerYes
AliasQuestion123Use it to identify the container after the WebService node runs, e.g., Question123.No
RestrictToGroupRestrict the container execution per user groupNo
BeforeExecutionRuleShould be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should runNo
PhraseThe question that will be sent to the userYes
CompetenceA competence already registered in the company. A new competence will be created if it does not exist in the company.No
SubjectA subject already registered in the company. A new subject will be created if it does not exist in the company.No
TopicA topic within the subject. It will be created if it does not exist.No
IgnoreExecFluxoIgnores other actions from the user aside from answering the actual question or ending all services. Can be “S” or “N”NNo
SensitiveDataPass ‘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.NNo
RightAnswerEnable this resource if you want to check if the answer is in the possible answers arrayNNo
RightAnswerValueThe points that will be earned by the user if he answers correctlyNo
AnswerType’N’ if you don’t want to send feedback about the answer. ‘Q’ if you want to send feedback.NNo
CorrectAnswerCommentWhen answerType is ‘Q’ then use this config to send a positive feedback to the userNo
IncorrectAnswerCommentWhen answerType is ‘Q’ then use this config to send a negative feedback to the userNo
DynamicValidationsWrite expressions using AnnA Functions that returns TRUE or FALSE. The execution will continue when the expression returns TRUENo
ValidationErrorSet a message for validation errors when dynamicValidations returns FALSENo
ValidationMaskSet a mask for the user answerNo
ExternalDataIt can store any information that you may want to retrieve with AnnA Functions, e.g., “LastAnswerJSON()” or “AnswersJSON()“No
PossibleAnswersIf “rightAnswer” is set to “S” then this property should be provided. A collection of strings containing the possible right answers to the questionNo

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:

[
{
"PropName": "Answer 1",
"PropValue": "Two"
},
{
"PropName": "Answer 2",
"PropValue": "2"
}
]

Alternative container

Sends a multiple-choice question to the user.

PropNamePropValueDescriptionDefaultRequired
TypeALTERNATIVEType of the containerYes
AliasAlternative123Use it to identify the container after the WebService node runs, e.g., Alternative123.No
RestrictToGroupRestrict the container execution per user groupNo
BeforeExecutionRuleShould be an expression. You can use AnnA Functions that returns “true” or “false” to decide if this container should runNo
PhraseThe question that will be sent to the userYes
CompetenceA competence already registered in the company. A new competence will be created if it does not exist in the company.No
SubjectA subject already registered in the company. A new subject will be created if it does not exist in the company.No
TopicA topic within the subject. It will be created if it does not exist.No
EnumerationSet the enumeration of the alternatives.
N = Numbers, L = Letters, R = Roman, I = List (WhatsApp Popup), B = Buttons (WhatsApp Buttons)
NNo
RandomizePass ‘S’ to shuffle the alternatives. Defaults to ‘N’NNo
RightAnswerEnable this resource if you want to check if the answer is in the possible answers arrayNNo
AnswerType’N’ if you don’t want to send feedback about the answer. ‘Q’ if you want to send feedback. Defaults to ‘N’NNo
AnswerTypeCommentThe message that will be sent when the user answers the questionNo
ExternalDataIt can store any information that you may want to retrieve with AnnA Functions, e.g., “LastAnswerJSON()” or “AnswersJSON()“No
AlternativesArray that contains the alternativesYes

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:

PropNamePropValueDescriptionDefaultRequired
AliasAlias of the alternative, can be used to identify the user answer in subsequent nodesNo
RestrictToGroupFill in the aliases of user groups that are registered within the company.No
ExhibitionRuleUse AnnA Functions to write an expression that returns TRUE or FALSE. If the expression returns TRUE then the container will be executed.No
PhraseText of the alternativeYes
IsCorrectAnswerOnly available when the “rightAnswer” option is set to ‘S’. Use ‘S’ to mark the alternative as correct answer.No
AlternativeValueA value to the alternatives that will be used in statistics.No
OrderOrder of the alternative.No
CommentMessage that will be sent to the user after he select the alternativeNo

Code example:

[
{
"PropName": "Alternative1",
"PropValue": [
{
"PropName": "Alias",
"PropValue": "Alternative001"
},
{
"PropName": "Phrase",
"PropValue": "2 two"
},
{
"PropName": "Order",
"PropValue": "1"
},
{
"PropName": "IsCorrectAnswer",
"PropValue": "S"
}
]
},
{
"PropName": "Alternative2",
"PropValue": [
{
"PropName": "Alias",
"PropValue": "Alternative002"
},
{
"PropName": "Phrase",
"PropValue": "5 five"
},
{
"PropName": "Order",
"PropValue": "2"
}
]
}
]