IBM Watson Assistant input - ibm-cloud

I'm trying to make my IBM chatbot asking the user question
ex: what's your name?
but there's no choice in define customer response to make it wait for the user answer, it just either options or numbers.

you define a customer response only if there is a special structure (e.g. options) or some special validation ( precentage).
When you model an action there is no need to wait for an arbitrary text from a user, as the intent is already set when the user entered the action.
Therefore in each step it is expected you collect some information from the user.

Related

IBM Watson Assistant: How to set a context variable from option response?

I couldn't figure out a problem with IBM Watson Assistant. I've chosen to use an Option type as response. That way, I can see a list on my chatbot where each item is clickable and has an associated value.
When a user clicks one of the options, the associated user input value is sent to the assistant. How can I give this value to a context variable? Is it possible?
Yes, that is possible for option responses and is the typical use case. I have demonstrated that in a simple chatbot I use in some of my talks.
I use different language code as options. Users can click on them and the result is saved in the variable langcode. Because users could have already specified what I would ask for, I check for it and save it.
The simple bot has more uses of options and the full skill is available in case you want to see all the details.

What is right way to create multi purpose rest end point?

I want to create a rest end point but I am not sure what is right way. For example I want to expose endpoint to create account but there are multiple account type like:
Normal account with property name, description, and current balance
Credit Card account with property name, description, current balance, grace period, billing date and current outstanding. Now the confusion is, Shall I create two endpoint for each of account type? or Shall I create single end point with all the property.
Shall I create two endpoint for each of account type? or Shall I create single end point with all the property.
How would you do it on a web site?
You might have a single create-account form; you collect the information that you need from the visitor, the form is submitted to the server, and the server looks at the form details to determine what kind of account to create. Create the account, and send back a response to the browser announcing where the web page describing the account is. And that's fine.
You might do the same thing with multiple forms; through a series of links you guide the visitor to the form that best fits their circumstances, and then the remaining work is the same as above - the form is submitted, the server looks at the form details to determine the account to create, the account is created, the server sends back a response to the browser announcing where the web page describing the account is. And that's also fine.
You could do the same thing with multiple forms, but have each of the forms submit using a different target URI; you could even have each form submitted to a different host! Again, the actions taken by the host receiving the form are the same - do the work, return the result announcing where the new web page is.
Thw browser doesn't care, it's just collecting form inputs using standardized form processing rules, and then submit the result using the meta data in the form.
You'll want different code responsible for creating each of the different kinds of accounts (the "separation of concerns" idea), but it doesn't much matter if the routing of the request to that code is done purely mechanically (because you are using different URI) or "by hand".

Handle No Match input with custom logic in Confirmation Intent using Actions SDK

When I use the Confirmation Helper Intent on an Actions SDK project, it works as it's supposed to. But I want to handle the case when the user's input doesn't mean either yes or no (a No Match situation). Currently Assistant automatically re-prompts the user in this situation.
Actions SDK provides the user's actual input when a confirmation is granted or denied. But is there any way to know what the user said in a No Match situation?
For example, let's say, in a Confirmation prompt, the user says: "I just need some eggs. Just give me some eggs". This would cause Assistant to show the same prompt to the user again. It happens automatically and I have no way of accessing what the user actually said. If I want to do something when the user says "I just need some eggs" I can't do it because I can't access what the user is saying. Moreover, I haven't seen any Intent getting fired in this situation.
So, how can I handle No Match situations with custom logic instead of giving the default re-prompt to the user?
The easiest way is to not use the confirmation helper and just create Intents that handle "yes" or "no" equivalents yourself.

Required parameters - Either/Or

I created an "intent" that I want to collect some contact information from. I want either their phone number or email address. As most users don't want to give both, I want to make it required that they share one of the other.
Is there a way to do this from the web app? Is there a way to accomplish this thru fulfillment code? or is there any other way to achieve this?
The either/or (or better put the if/else) logic can be achieved via follow up intents like this:
Create an intent and ask your user if they rather give you their phone or their email
Create a follow up intent for when the user replies with 'email' and another follow up intent for when the user replies with 'phone'. At the 'Responses' in each intent, ask for the user's email or address accordingly and then follow up the conversation as you'd do with any other intents.
To create follow up intents, hover over an intent at the intents page and click at the 'Add follow up intent' option.
If there isn't a screen input, consider that it may be difficult for the user to input their emails so make sure you do appropriate checks that it is a valid email format and of course ask your users for confirmation (ex. the submitted email is xyz#app.com. Shall I proceed?)
In a given intent, you can enable "use webhook for slot-filling" to have Dialogflow call your webhook each time the intent is matched.
https://dialogflow.com/docs/fulfillment#slot_filling
In your fulfillment code, you can check the presence of either parameter and respond appropriately if neither is provided.

SharePoint send an email to users specified in a Field

I have a SharePoint list of Issues and have set a column (called Alert) to a “Person or Group” (allowing multiple names).
I would like the system to send an email to all the users listed in the Alert field, if the respective Issue is modified.
How do I set the Workflow to send an email the users as specified by the data in the Alert field (if there is any)? I know how to use the Workflow etc – the problem the “To” part of the Workflow's email.
(Sorry if this item has already been tackled – I've searched Stack Overflow and Googled around but could not find an answer)
Preferably through SharePoint Designer. i.e. preferably with no Code.
Regards.
I have limited experience with SP Designer workflows, but have you tried the email action with "Workflow Lookup" selected in the To field? This allows you to use specific fields from the submitted list item.
You'll want to use the SPUtility.SentEmail method which will send an email to the string you pass it from using the context of the SharePoint server, saving you from writing the code youself to send it.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.sendemail.aspx
Use the "Build Dynamic String" workflow action to compose the list of email addresses. You can then use the dynamic string variable in the TO field. You can find the variable under "Workflow Data" in the lookup dialog.
I believe that the SPD workflows can only send to a person field that allows single selections. If you need to send an email to multiple users you will have to find a custom action (similar to http://www.codeplex.com/SPDActivities) or develop a Windows Workflow Foundation workflow using Visual Studio.
I have found a workaround to make the workflow send emails to multiple users entered under the field type Person/Group:
Create a workflow variable with type String
Assign the variable to Current Item field name and return type String
Then send an email To: Variable Name