Detect Language
Powered by the IBM Watson Language API, the Detect Language action identifies the language a text message is written in. You can then use the Translate action to convert the text into another language.
Note: The functionality of this action is text-related only.
Available Variables
Available Variables are placeholders for information that are automatically determined based on the contents of your flow. For example, if your flow begins with an Inbound Call trigger, the caller’s phone number is stored as a $ANI variable. You can include sending a follow up SMS to the caller later in your flow by including the $ANI variable in the Send SMS action Inputs.
You can drag and drop the variables displayed in this section into the Inputs and Advanced fields.
Check out How to Use Variables in SmartFlows for more information.
Inputs
Input Name | Description |
---|---|
Text/Message |
The message you want to analyze. Drag the variable where the text is stored into this field. For example, an incoming text message would be stored in the ISMS action's variable $ISMS_x.message. |
Variables
The Detect Language action creates several variables. These variables can be used later on in a flow (through SMS, External Web Call, Dial , etc.).
Variable Name | Description |
---|---|
$DETECTLANG_#.responsebody | Entire response from Watson Language API. |
$DETECTLANG_#.statuscode | Code that indicates the status of the API response (i.e., 200 = success, 404 = not found, 403 = forbidden). |
$DETECTLANG_#.response.languages[0] | The language that was returned by the Detect Language API that can be used to translate to English or another language. |
Check out How to Use Variables in SmartFlows for more information about using variables in your flow.
Action
Each Detect Language action includes two exit ports corresponding to the following outcomes:
-
On Success: The course of the flow if the language is successfully detected (port 1)
-
On Failure: The course of the flow if the language is not successfully detected (port 2)
An action should be connected to each of the exit ports to deploy your flow and the port order cannot be rearranged.