I finally completed my Pregnancy Countdown Alexa Skill! I briefly mentioned in my last post that I was conceptualizing an app that helps keep track of how long a woman has left in her pregnancy. Well, I am happy to announce that it is now a live Alexa skill. It has been an awesome learning experience, and I wanted to share some of the challenges I faced as well as things that I learned with you.

For my Pregnancy Countdown App, I needed to be able to persist data for the user (namely, the baby’s due date). This was the main challenge I faced in creating this app. Because I was already hosting the code in an Amazon Web Service (AWS) Lambda function, I decided to use Amazon’s DynamoDB to store the data for the app as well. Amazon has a sample skill ScoreKeeper that also persists data to DynamoDB. It is a great resource and I used it to model my code to save due dates for users of Pregnancy Countdown.

Initially I had a lot of trouble connecting the table I created in DynamoDB with my Alexa Skill. After a lot of head banging, and trying a hundred different things, I realized that the partition key I was using, “CustomerID”, was case sensitive and needed to match my code that used “CustomerId”. All in all, it is really quite simple to connect to DynamoDB. Amazon handles most of the grunt work behind the scenes, you just have to create the table and then call it from your Lambda function by the same name (watch your capitalization!) and Amazon does the rest.

Once I could save the due date, I used the sample skill to model how to also access the due date. From the due date, I wanted to create the functionality to give a current countdown in days, weeks, or months for the user. The main challenge I faced was deciding whether I should let the user give input for the format of the output (whether to tell days, weeks, or months left) or to just give it depending on a predetermined calculation. I decided to use a little of both. If the user gave an input time format, then I returned the same time format (if they asked for weeks left I gave them weeks left). However, if no input was given (if they just asked how much time they had left), I defaulted to days.

Other functionality I included in the app was to tell how far along the pregnancy is, tell when the due date was set to, and tell how big the baby is, as well as to delete the pregnancy due date. It was challenging to code the app to keep it neutral, so that either the pregnant person or a man or woman could ask how far along his or her wife/girlfriend/partner was. I even did a little bit of user testing with both men and women to see how each interacted with the app, which was very helpful.

Finally, I injected a little bit of personality to the app by adding little anecdotes to the responses for how long was left in the pregnancy. I included things like “This week your baby has started urinating. You’re probably going to start doing that more too.” It is basic in design, yet still very practical and personable. Overall, I am extremely pleased with how it all turned out. If you or someone you know is pregnant, take advantage of Pregnancy Countdown to help you keep track of the growth of your baby and the time remaining until your little bundle of joy arrives!