Training
Learning path
This learning path covers using Power Pages templates for quick deployment, managing flow errors with notifications and error handling, and optimizing data use through expressions and functions.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO: Composer v1.x and v2.x
This article introduces the validation functionality provided in Bot Framework Composer. The validation functionality helps you identify syntax errors and provide suggested fixes when you author .lg files, .lu files, and expressions during the process of developing a bot using Composer. With the help of the validation functionality, your bot-authoring experience will be improved and you can easily build a functional bot that can run correctly.
When there are errors in Composer, the button to start the bot will be disabled.
Selecting the error or warning icon will navigate you to the Problems pane at the bottom of Composer where you can view a full list of the errors and warnings.
Selecting the Errors and Warnings buttons will hide or display your bot's error and warning messages.
Starting in version 2.0 of Composer, there's also an Output pane that shows the standard output/error stream, when the bot is running, from the .NET or JavaScript runtime. This includes start up information and runtime errors.
For information about how to use the Web Chat Inspector and the Watch panel, see the article about testing and debugging bots with Web Chat.
When an .lg file has syntax errors, the Bot responses code editor displays a red wavy line under the error. While you have template errors, you can't switch to the response editor without losing your current response template.
In the example .lg template above, abc is invalid. Do the following to diagnose and fix the error:
Read the error message beneath the editor and click Refer to the syntax documentation here to refer to the syntax documentation.
Hover your mouse over the erroneous part and read the detailed error message with suggested fixes.
Note
If you don't find the error message helpful, read the .lg file format article and use the correct syntax to compose the language generation template.
Select Bot Responses from the Composer menu, then select Show code. You'll find the error is also saved and updated here, as shown below:
Hover your mouse over the erroneous part. You'll see the detailed error message with suggested fixes.
In this example, the error message indicates a - is missing in the template. After you add the - sign in the lg template, you'll see the error message disappear.
If you go back to the code editor, you'll see the change is updated and error disappear as well. You'll also be able to switch back to the response editor.
Warning
Switching from the code editor to the response editor will delete any templates that aren't activity response templates. Be cautious when switching between the two editors.
When you create an Intent recognized trigger and your .lu file has syntax errors, a red wavy line will show under the error in the Trigger phrases, and the border of the box will appear red.
Do the following to diagnose and fix the error:
Selecting the Refer to the syntax documentation here link in the error will open the .lu file format article.
Hover your mouse over the erroneous part and read the detailed error message with suggested fixes.
Note
If you don't find the error message helpful, read the .lu file format article and use the correct syntax to compose the language understanding template.
When you send a response with an invalid expression, a warning will appear at the top right of Composer. If you're in the code editor view, you'll see a red wavy line underneath the erroneous expression. The box around the expression will appear yellow, as seen below.
To diagnose and fix the error, read the error message and select Refer to the syntax documentation here to be taken to the syntax documentation. For more information see Adaptive expressions syntax.
Once the expression warning is fixed, the red wavy line under the expression will disappear, and the border around the editor will appear black.
For users who have custom functions defined in a custom runtime, additional configuration is required in the customFunctions
field of the Bot Settings page. If you don't have the customFunctions
setting configured properly, Composer will identify custom functions as errors, and the Start Bot button (or the Restart Bot button) will be disabled.
To configure the customFunctions
setting:
Select Project Settings from the Composer menu then toggle Advanced Settings View (json).
In the customFunctions
field, add the names of the custom functions. For example:
"customFunctions": [
"AskBot.stripTags"
]
Tip
You can set the customFunctions
field to functionPrefix.*
to support validation of custom functions with a specific prefix, for example AskBot.*
.
Training
Learning path
This learning path covers using Power Pages templates for quick deployment, managing flow errors with notifications and error handling, and optimizing data use through expressions and functions.