Google DialogFlow: Query Firebase database's strategy/design - dialogflow-es

I have a project related to DialogFlow flow chart design where end-user want to look up their information in database (i'm assuming Firebase) based on Age and Gender.
I was actually a little confused because in order to query the information in Firebase, we need to know the "primary key" value which is obviously not Age or Gender.
So, it could work if we design a table with "customer id" as primary key and require customer to type or tell their ID.
For example, like the following workflow.
Customer: Hi
Bot: I'm BOT. How can i help you?
Customer: I want to know everything about me.
Bot: Please tel me your ID
Customer: ABC12345
Bot: Here's your information
Anyone has experiences with GoogleDialogFlow can help on this?

Yes, you can have the customer id as a key in firebase.

Related

Use GoCardless payments with Zapier

I'm trying to use Zapier to update Google Sheets with payment information from GoCardless. I can't see anything in the received event webhook that I can use to match a payment to a customer though.
events:
1:
id: EVTExxx8B
created_at: 2021-03-29T21:57:38.658Z
resource_type: payments
action: confirmed
links:
payment: indxxx23
details
origin: gocardless
cause: payment_confirmed
bank_account_id: BA00xxx9N
description: Enough time has passed since the payment was submitted for the banks to
return an error, so this payment is now confirmed.
metadata:
meta:
webhook_id: WB00xxxQTY
querystring:
I presume I need to match one of these IDs against the list of customers via the API but I'm a bit stuck on how to do this with Zapier. I can't find anything in the documentation to help (that I understand at least anyway). Has anyone managed to achieve anything similar please? Many thanks.
Not a full answer as I am not familiar with the details of Zapier, but this might point you in the right direction.
You can use the payment link (events -> links -> payment) to get the payment resource from their API, which will have a mandate link, which you might have saved somewhere. If not saved, you will need yet another query on the mandate which will give you the associated customer.

How to use Power Virtual Agents and Power Automate to let a Bot write in a user's outlook-calendar

I have created an bot for microsoft teams with power virtual agents. This bot works fine and people can talk with it in ms teams and give the bot some information about dates. For example you could tell the bot a start-date and an end-date for days you aren't able to work.
With the authentification in teams the bot also knows the username and the id of the person, who is talking with it.
Now I like to create an automated flow, which the bot should trigger with the infos like username, userid, startdate and enddate, which should do the following steps:
open/find the specific user's calendar in outlook/teams (I'm pretty sure both use the same calendar)
create for each day in the range of startdate and enddate a (full-day) entry, which says "unavailable"
for each conflict with another meeting in entries of Step 2. cancel the meeting (for the user with username)
post a summary in a specific ms teams channel
I got Step 4 already working fine.
Step 2, I think I've figured out aswell, but with regard to my following problem at Step 1:
There is the template flow: Get calendar, which returns (all?) available calendars. And there is another flow template for creating entries in a specific calendar(Step 2 with option full-day entry), which needs the calendar ID to work.
My big problem is, how am I supposed to get the calendar ID of a specific user?
Is there a way to get the specific calendarID for a username or a userid?
And then what can I do about Step 3?
Thank you a lot for your help.
greets Vulnin
Using Graph API you can get User Calendar ID GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendar
Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The output of GET command in http returns raw JSON so, you have to parse JSON to use values.
For point 3 Only the organizer can cancel the meeting. Please refer to this document.
You can decline a meeting using Graph API request with POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline request.

How to make a restaurant chabot information send to a interface that people can view?

I'm making a chatbot on dialogflow that can fulfill basic needs of a restaurant (booking a table, ordering food, maybe leaving a review etc.)
I have been able to make reservations for restaurants, and I know how to extract necessary information for ordering food, but what I don't know/ fully understand is the process of taking that information and the restaurant being able to see it on the other side. When I did restaurant bookings for example, the way the restaurant could see a booking would be on a Google Calendar API I connected to the dialogflow agent.
Here is an example of how the conversation would go to maybe further clarify:
I know how to do this:
User: I'd like to buy a small Dark roast coffee
Bot: Okay, is that everything?
User: Yes
Bot: Okay, Your small Dark roast is being made!
But this is completely useless if it goes no where and the restaurant can't see the order on the other side (ie: can't see it on a order screen or a program)
I know this involves some sort of fulfillment in the inline editor or possibly a heroku API, but I'm pretty new to web development so I don't fully understand how to make this order to go through so the restaurant could see it.
Any suggestions or advice?
Thanks for the help!
You have to store data/dialogs to the backend.
You need also two roles in the frontend. The customer and the restaurant. Whitch means, that you have to implement authentication (Login - Logout - Signup), and authorization based on the user.

Basic Concept of Chatbot using Wit.ai

I am trying to create a chatbot application where user can create their own bot like Botengine. After going through google I saw I need some NLP api to process user's query. As per wit.ai basic example I can set and get data. Now I am confused, How I am going to create a botengine?
So as far I understand the flow, Here is an example for pizza delivery:-
User will enter a welcome message i.e - Hi, Hello ...
Welcome reply will be saved by bot owner in my database.
User will enter some query, then I will hit wit.ai API to process that query. Example :- Users query is "What kind of pizza's available in your store" and wit.ai will respond with the details of intent "pizza_type"
Then I will search for the intent return by wit in my database.
So, is that the right flow to create a chatbot? Am I in the right direction? Could anyone give me some link or some example so I can go through it. I want to create this application using nodejs. I have also found some example in node-wit, but can't find how I will implement this.
Thanks
What you need is webhook. You need to call different API's based on the user intent. I believe you can distinguish between different intents using parameters available in request. Check this out - Creating nodejs webhook for dialogflow

Create a 7 quest. & answer Alexa skill

I'm trying to figure out the best way to create a skill that allows a user to answer questions within a skill. Here's the flow...
Alexa open 'skill'
Alexa: How many planets are in the solar system?
User:
Code: collect response and store to a db
Alex: ask Question 2
User:
Code: collect response and store to a db.
I'm stuck on how to collect the answer (the voice response) from the user and then move to the next question in the queue? I do know how to save records to a db.
Does anyone know of any good examples i can follow?
For each of the pieces of data that you want the user to supply, you should set those up as a "slot". Use the new skill builder tool to set up the intent, the slots that go with it, and the prompts for those slots.
You can then "delegate" the dialog to Alexa who will prompt the user for each slot value in turn, and you'll get a request to your skill code with all the slots populated once she is done. There's detailed documentation here which I hope will help https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/dialog-interface-reference but for me, once I understood that I needed a slot per answer, I was able to follow the documentation and get my skill working.

Resources