# Dialog Actions

Conversational interactions of the virtual agent, especially when running a business process can be broken down into discrete dialog actions. For example, prompt for an input, what to expect during a turn of a conversation etc.

Please find the dialog actions that Dhee supports using which you can define the dialog transitions as described in further automation chapters.

<table><thead><tr><th width="329">Function</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>CALL_API</td><td>To make a call to a backend REST API</td><td></td></tr><tr><td>GET</td><td>To expect a slot value while displaying the prompt</td><td></td></tr><tr><td>EXPECT (Silent GET)</td><td>To expect a slot value without prompt</td><td></td></tr><tr><td>SPEAK</td><td>To display a message on the chatbot</td><td></td></tr><tr><td>SPEAK_N_EXIT</td><td>To display a message and exiting an intent</td><td></td></tr><tr><td>SPEAK_4_EACH</td><td>To speak multiple messages with the messages comma separated </td><td></td></tr><tr><td>SET</td><td>To equate or initialise a value to a slot  </td><td></td></tr><tr><td>DO</td><td>To call upon another intent</td><td></td></tr><tr><td>TAKE_PAYMENT</td><td>To take the payments from end users</td><td></td></tr><tr><td>COMMAND</td><td>To perform a specific command, for example, <em>COMMAND END_CONVERSATION</em> to end the conversation</td><td></td></tr><tr><td>COMMAND_N_TEXT</td><td>To perform both command and text together</td><td></td></tr><tr><td>ESCALATE</td><td>To escalate the conversation to supervisors</td><td></td></tr><tr><td>WAIT</td><td>To add a waiting period in the chatbot</td><td></td></tr><tr><td>EMAIL</td><td>To perform emailer action </td><td></td></tr><tr><td>SAVE_2_SHEET</td><td>Save to spreadsheets action</td><td></td></tr><tr><td>SAVE_2_THIS_SHEET</td><td>Save to spreadsheets action from multiple intents</td><td></td></tr><tr><td>STORE_FEEDBACK</td><td>To store the user feedback</td><td></td></tr></tbody></table>

Find below the syntax for some the functions

**SAVE\_2\_SHEET**

SAVE\_2\_SHEET {slot 1} {slot 2} .. {slot K}\
The above command is to be called once per run of a top level intent. The location to find these spreadsheets is - Reports & Invoice/ Live Statistics/Output Spreadsheets

**SAVE\_2\_THIS\_SHEET**&#x20;

SAVE\_2\_THIS\_SHEET {sheet name} {slot 1} {slot 2} .. {slot K}\
The advantage of this command over the existing intent specific sheets is that you can write to the same sheet from multiple intents (by using the same arbitrarily set name for the sheet from those intents' DSMs)

**TAKE\_PAYMENT**&#x20;

TAKE\_PAYMENT ${amount slot} INTO {payment status slot}\
\&#xNAN;*amount slot* will be holding the value of amount to be asked from user, and can be replaced with any slot name which you use for the purpose.&#x20;

Similarly, *payment status slot* will hold Boolean result of the transaction (true or false). Can be replaced with any slot name which you use for the purpose.

**COMMAND**

* For signalling javascript events to parent pages use DSM Transition function -\
  COMMAND EVENT (any event code you want to pass, without these brackets)
* For closing widget and ending conversation -\
  COMMAND END\_CONVERSATION

**COMMAND\_N\_TEXT**&#x20;

COMMAND\_N\_TEXT \<COMMAND> \<MLT>\
The advantage of this command over the *COMMAND* is that we can now send command and text together. For example, *COMMAND\_N\_TEXT RingAlarm TimeForMeetingMLT*

**EMAIL**

EMAIL emailId1|emailId2|emailIdN subjectMltName contentMltName\
subjectMltName should contain the subject of the email and contentMltName should contain the contents of the email

**ESCALATE**

* To escalate the conversation for every supervisor -\
  ESCALATE
* To escalate to a specific domain (domain-wise escalation) -\
  ESCALATE domainName
