Validate Your Skill
In this step, you’ll learn how to:
- Validate that your skill is working as expected.
- Perform common troubleshooting.
- Publish your skill to others.
At this point, the skill is ready to be tested end to end! Let’s make sure everything is working as expected by testing on your Alexa-enabled device. If you don’t have a device, try Echosim.io, a community project that allows you to use an Echo in your web browser.
- Try out the following request: “Alexa, open Salesforce Demo.”
- Alexa welcomes you and asks you to create a voice code.
- Choose a four-digit code and speak it back.
- Alexa creates and stores the code, and then let’s you ask about your recent leads or opportunities.
If Alexa didn’t perform as expected, fret not! Here are a couple of common troubleshooting tacts that you can take to try and see where things went awry.
Make Sure That Your Alexa Device (or Echosim) Is Working As Expected: Make sure that a basic request like “Alexa, what time is it?” works. If that isn’t working, there can be a problem with your device. Try restarting the device first and double checking that the Wi-Fi network the device is on is working as expected.
Check That You Only Have One Salesforce Demo Skill: If you have done this project more than once, it is possible your skill is conflicting with other skills with the same name.
- Log in to the Amazon Developer Console.
- Go to your Skills page under the Alexa category and Alexa Skills Kit section.
- Check for multiple versions of the Salesforce Demo skill. Remove any older versions and retry enabling and linking your skill.
Check the Lambda Logs: If while using the skill, you continue to experience errors, try looking at your Amazon Cloudwatch logs.
- Log in to the
AWS Console and type
CloudWatchin the AWS services search box at the top of the page and select CloudWatch.
- Click Logs in the menu.
- Click your log group named /aws/lambda/ask-custom-AlexaSalesforceDemo-default.
- Click the log stream with the most recent Last Event Time. This should be the top item.
- From here, you see individual log statements from each invocation of your Lambda function. The error messages visible here may give you guidance to specific areas of the skill that may need to be reconfigured or adjusted.
- If you make changes to any of the code files, such as
skill-sample-nodejs-salesforce/lambda/custom/constants.js, don’t forget to run the "ask deploy" command to push your changes back out to Lambda.
Once you prove the basic skill flow works, try to change your voice code too. If at any point you aren’t sure what else you can ask, just say “Help.”
Congratulations! You’ve successfully built and tested a private Alexa skill that is connected to a Salesforce org.
With the abilities you’ve learned here, you probably want to show this off to more users—maybe even the whole office! In order to do that, you publish the private skill and then grant permissions to an Alexa for Business account in order to distribute it to other users.
Alexa for Business is an AWS service that lets customers use Alexa to voice-enable their workplace by providing the tools needed to manage Alexa devices, skills, and users at scale. Through these tools, your private skill can be enabled by an organization and distributed to the organization’s enrolled users.
For more instructions on how to publish your private skill and sign up for Alexa for Business, click here.
You now have an example of a skill that uses account linking with a Salesforce account. This lets you make sure that the skill can only be accessed by an individual with permission. You also have an example voice code flow, which the user must know when the skill is invoked.
Use this project as a building block to try new things and find ways to make everyone around you more productive in the workplace. We can’t wait to see what new and innovative skills you come up with.