Create Lambda Function - 2

8 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€42.93
List Price:  €60.11
You save:  €17.17
£37.19
List Price:  £52.07
You save:  £14.88
CA$69.08
List Price:  CA$96.72
You save:  CA$27.64
A$76.68
List Price:  A$107.37
You save:  A$30.68
S$64.45
List Price:  S$90.24
You save:  S$25.78
HK$389.86
List Price:  HK$545.84
You save:  HK$155.97
CHF 40.24
List Price:  CHF 56.34
You save:  CHF 16.10
NOK kr504.78
List Price:  NOK kr706.74
You save:  NOK kr201.95
DKK kr320.47
List Price:  DKK kr448.69
You save:  DKK kr128.21
NZ$85.31
List Price:  NZ$119.45
You save:  NZ$34.13
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,079.20
List Price:  ৳8,511.37
You save:  ৳2,432.16
₹4,406.43
List Price:  ₹6,169.35
You save:  ₹1,762.92
RM211.33
List Price:  RM295.88
You save:  RM84.55
₦76,334.73
List Price:  ₦106,874.73
You save:  ₦30,540
₨14,084.68
List Price:  ₨19,719.68
You save:  ₨5,635
฿1,616.44
List Price:  ฿2,263.14
You save:  ฿646.70
₺2,058.15
List Price:  ₺2,881.58
You save:  ₺823.42
B$272.99
List Price:  B$382.20
You save:  B$109.21
R889.64
List Price:  R1,245.57
You save:  R355.92
Лв83.88
List Price:  Лв117.43
You save:  Лв33.55
₩69,680.77
List Price:  ₩97,558.65
You save:  ₩27,877.88
₪168.19
List Price:  ₪235.48
You save:  ₪67.28
₱2,855.66
List Price:  ₱3,998.15
You save:  ₱1,142.49
¥7,414.59
List Price:  ¥10,381.02
You save:  ¥2,966.43
MX$938.02
List Price:  MX$1,313.31
You save:  MX$375.28
QR181.99
List Price:  QR254.80
You save:  QR72.81
P671.16
List Price:  P939.68
You save:  P268.52
KSh6,458.70
List Price:  KSh9,042.70
You save:  KSh2,584
E£2,426.85
List Price:  E£3,397.79
You save:  E£970.93
ብር7,145.56
List Price:  ብር10,004.36
You save:  ብር2,858.79
Kz45,588.63
List Price:  Kz63,827.73
You save:  Kz18,239.10
CLP$48,410.81
List Price:  CLP$67,779.01
You save:  CLP$19,368.20
CN¥356.46
List Price:  CN¥499.08
You save:  CN¥142.61
RD$3,148.14
List Price:  RD$4,407.65
You save:  RD$1,259.51
DA6,494.64
List Price:  DA9,093.02
You save:  DA2,598.37
FJ$113.05
List Price:  FJ$158.28
You save:  FJ$45.23
Q382.93
List Price:  Q536.13
You save:  Q153.20
GY$10,444.37
List Price:  GY$14,622.96
You save:  GY$4,178.58
ISK kr6,166.26
List Price:  ISK kr8,633.26
You save:  ISK kr2,467
DH454.10
List Price:  DH635.79
You save:  DH181.68
L835.20
List Price:  L1,169.35
You save:  L334.14
ден2,638.40
List Price:  ден3,693.98
You save:  ден1,055.57
MOP$401.17
List Price:  MOP$561.67
You save:  MOP$160.50
N$880.65
List Price:  N$1,232.98
You save:  N$352.33
C$1,837.18
List Price:  C$2,572.20
You save:  C$735.01
रु7,040.44
List Price:  रु9,857.19
You save:  रु2,816.74
S/176.58
List Price:  S/247.23
You save:  S/70.65
K208.28
List Price:  K291.61
You save:  K83.33
SAR187.56
List Price:  SAR262.60
You save:  SAR75.04
ZK1,187.24
List Price:  ZK1,662.23
You save:  ZK474.99
L218
List Price:  L305.21
You save:  L87.21
Kč1,049.72
List Price:  Kč1,469.69
You save:  Kč419.97
Ft16,908.91
List Price:  Ft23,673.83
You save:  Ft6,764.91
SEK kr472.91
List Price:  SEK kr662.12
You save:  SEK kr189.20
ARS$68,039.53
List Price:  ARS$95,260.79
You save:  ARS$27,221.26
Bs344.97
List Price:  Bs482.98
You save:  Bs138.01
COP$200,187.13
List Price:  COP$280,278
You save:  COP$80,090.87
₡25,238.32
List Price:  ₡35,335.67
You save:  ₡10,097.34
L1,308.73
List Price:  L1,832.33
You save:  L523.60
₲360,572.92
List Price:  ₲504,830.94
You save:  ₲144,258.02
$U2,003.11
List Price:  $U2,804.51
You save:  $U801.40
zł182.64
List Price:  zł255.72
You save:  zł73.07
Already have an account? Log In

Transcript

Hello guys, welcome to the ninth session of create custom annex SQL using AWS lambda function to do this for beginners. In this session, we will continue to the previous session and update lambda function. Here is an example that we are going to tell when a user opens or ski first time, we will display a welcome message to the user. After this when a user sends a request to Hello intent will display How are you when a user signs a request to display greeting, we will display a welcome message we can name that user views. Along with these we will add it in session so we can use it in subsequent requests. When the user signs a request to fabric language, we will obtain value an ID from intent and name from the session and display.

Let us copy this JavaScript code. I'm using Visual Studio code for editing You can edit it here or use any other editor to. First of all I'm removing callback as we do not require it. event will contain entire JSON data that will be signed by Alexa. Which into session contents and request. Update requests request object from the event.

Create a default response with the direct unable to process your request. Create try catch block. In catch block written exception details using failed metal. When a user sends a request the first time his request type will be launched request are the first takeaways contract and welcome to enforce an access key. Otherwise, if it is an intent request and you switch case law and create a case for each intent in Hello intent, I'm going to return Hello How about you in display greeting. Create a handler and pass intent data.

Okay in fabric language created handler but here I'm passing entire event object as we need to obtain the person name from the session. At the end of Christ return response object using success method. Let's create a hand For display greeting often mean from slots in written response with text, welcome back. Good money along with text message you also need to set this name in session. For this pass an object to make response method is it will get session data. If it was crazy, then set it in session attribute.

Create a handler for fabric language you'll never get the event often select language from resolutions If we got selected language, then have a name and ID from it. I think person name from sessions activity. If session data is available, then opt in for sending from the session otherwise tech guest users and create a response with text. A person needs like language name, whose ID is language It is in a response with unable to identify your favorite language message. Here we have created a handler that is copies and updated the our lambda function so this test event, select launch request and click on test. You'd be God.

Welcome to our first Alexa skill as expected. Many developers think that it would be good if we will test our lambda for each event before testing it in the Alexa simulator for against any edit a ghost, then you can identify it here. I have already taken Take all of this events, so I will skip this step. But I think it's a good idea to directly test it in simulator. The simulator shows all JSON data for request and response. So it's easy to test.

Refresh testing later. net is right first demo, we got a welcome message. We need to start our skill by writing its invocation name. So I'm writing the first demo that is saying, Hey, we got Hello, how are you? Know I'm sending. I'm Jeff Bezos.

Here you can see that it was added in session attributes. That is right. My name is Lila. We got Welcome back nilay. It will pick a name from slots That is sent I like PHP it shows proper language name and ID as well as personally from the session. Now, I'm sending I love Bye, it will automatically convert by to five that is it.

Here we have created our fourth thing and integrate it with lambda. Let us see what we are learning this session. For this we need to create lambda function in AWS trigger it on Alexa skated update AR n in skill it is a Request Handler method in which we have checked request type is launch request, then display this message in case of interest Request based on intent mean perform the operation. Here we have obtained the name from this lock and language from resolution and also to try the name from the session. In this method generate simple response structure into session attributes if session data was passed. Thanks for watching this video.

If you have any doubts, please feel free to contact me Have a nice day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.