Is there a way to show dynamic suggestion chips in dialogflow or dynamic list response? - node.js

I am trying to show stores to the user, but that stores need to be dynamic and should come from the database according to the user's current location.
User at Location1
user: show nearby stores
assistant: I need your location, can I get that?
user: yes
assistant: you are at location1, these are the stores near you.
Store1, Store2, Store3 (Suggestion Chips)
suppose if tomorrow the user is at a different location and ask the same question then he should be able to see other stores.
User at Location2
user: show nearby stores
assistant: I need your location, can I get that?
user: yes
assistant: you are at location2, these are the stores near you.
Store4, Store5, Store6 (Suggestion Chips)
I want to show these stores dynamically according to the user's location, in the form of suggestion chips, or in the form of list response.

Are you using a webhook? That would be the standard way of doing anything dynamic.
This codelab shows how to use the Dialogflow inline editor for dynamic responses.
You can use standard JavaScript to implement your decision logic and return dynamic suggestion chips.
If you want to get the users location, you need to use Permissions, there are neat helpers for that as well.
If you have more information on what you have tried so far, we can help you with more specific resources.

Related

Handling different user types and data access in react

I am working on a React application with two user types: Buyer and Seller. A Seller can access some (not all) data from the user through a search bar using the user's email. So for example, if a buyer wants to know what interests the buyer to buy, and he has the user's email and did a search query it can show the user's interest if and only if the user made these data available to show if looked up.
Now, I have two user types, and one of the users Seller is getting access to info from the other Buyer. How to implement that the right way? And how to make sure the search is working properly. Any ideas? Thanks!
You can really only achieve this properly through a database, what you want to do is have a user table that contains all of the users connected to your app, then, one of the fields you would have for the user is AccountType, there, you would declare a 0 for a buyer or a 1 for a seller. For the search bar you would use a FlatList that contains the data you want to display, since your question is so broad I can't really provide you with examples, but if you read this you should be able to make what you want:
For the database (using MySql): https://dev.mysql.com/doc/refman/8.0/en/
For the FlatList and SearchBar: https://www.geeksforgeeks.org/how-to-add-searchbar-in-react-native/ - https://reactnative.dev/docs/flatlist

How to create dynamic required parameter

I'm making chatbot with Dialogflow using console and client library api.
I created entity(Composite entity) that have a location data.
And I have a intent using my custom location entity as a required parameter.
That entity consists of 3entities(each entities is map entity)
Like this:
#step1:step1
#step2:step2
#step3:step3
United States(step1), New York(step2), xxx(step3)
(The next step, the smaller the area.)
And if User typed only one step, have to next step.
So far, example scenario is:
Agent: Please type location
User: New York
Then, Return some data by querying the database using location data.
But if many step1 data has New York(step2), I want to listup step1 and show user it as a required parameter.
What I want is:
Agent: Canada, UK, US has a New York, Please select one.
User: Canada
So, I want to create dynamic required parameter, like above case.
Is there any good idea for solve this problem?
It's okay if it's not a way to implement the required parameters.
If I understand correctly you want to should create dynamic response.
When you follow the documentation to fulfillment. There is example there:
For example, if an end-user wants to schedule a haircut on Friday,
your service can check your database and respond to the end-user with
availability information for Friday.
So this is very similar to your use case, when you get "New York" you have to query for possible choices. You have to follow this documentation.

Dialogflow sys.location to detect full address (?)

I cant find a why to handle this situation:
Agent: Tell me your address
User Via j.f. Kennedy, Padova
in my weebhook I would like to receive something like:
{city:"Padova", streets:"Via John Fitzgerald Kennedy"}
instead of the value of the street detect by dialogflow using sys.location:
{city:"Padova", streets:"Via j.f Kennedy"}
My goal is to have the full name of the streets in my weebhook, I read https://cloud.google.com/dialogflow-enterprise/docs/reference/system-entities but I dont find help to my problem. If its not possible handle this with diaolog flow theres another way?
as said by sid8491, in dialogflow it isn't possible, you need to use a weebhook to pass the address that you are getting from the user to an API, I had the same issue and here in France, the government has an API which list all the addresses in France. If the address isn't known, the API return a list of the most matching addresses.
Often postal compagnies have this kind of API

How to show list of products in google assistant without selecting any of them?

Currently i am building a chatbot where i need to display list of products with its description. I tried Carousel, Browsable Carousel and List but they all allow to select any options from the list.
I want to display the products but do not allow to select any of them.
I am using dialogflow as NLP and sending fulfillment using action-on-google's dialogflow node.js library.
Can anyone help me implementing this ?
You can try sending a single Basic Card with an image, if that is suitable for the response. You can also look into using a Table Card, however it doesn't allow for images in the cells - just a single image for the table.
There is no way to prevent a List or Carousel item from being selected, but you can certainly handle the response by ignoring what they've selected and re-prompting them with whatever you've prompted them with after showing the carousel/list. (Or even just re-showing the list and re-prompting them.)
However, it really isn't clear why the items are for information only and that speaking them isn't intended to continue the conversation. Would it make sense that, if a user selected one, you might provide additional information that can be useful? What would a user expect?

How do we make a crystal report print only specific fields based off of the user running the report?

We use a construction software, Viewpoint. We need a report to print the GL Accounts associated only with the user running the report. I was wondering if anyone had any ideas on how I could easily and efficiently achieve this? My "last-resort alternative" is just creating separate reports for each GL that pulls only that GL's info.
It depends on how the accounts are associated to the user. If there is a link, you can simply create a user parameter that asks for the user name. Then in the record select of the report you only pull accounts that match the user name in the parameter.
So, for example your parameter is called {?userName}. In the Record Select the formula would something like {Accounts.Salesman} = {?userName}, where {Accounts.Salesman} would be the field that links the user with the account.
You can get the current user name and use it to filter the records in your report. There are 2 ways to do this :
create a parameter, hide it and automatically fill the value. You
will need a special viewer for this scenario. Let me know if this is
what would you prefer I can give you some links. If you leave the
parameter visible the user can insert any value and view any records
use an UFL . For example this one:
http://www.viksoe.dk/code/u2lwin32.htm provides a function LoginName
which will return currently logged user. There are other UFLs which
support similar functionality, check if your company is already
using something . This one is free. You need to register the UFL on
each system which will run the report . Once registered the
available functions will become available for formulas.
I personally prefer the viewer solution because it is more flexible and will cover other scenarios too. However if you need just the username UFL will be a better approach.

Resources