Watson Assistant -- Prompting for required slot not working - ibm-watson

I have this node on the dialog tree of my Watson Assistant
So this node should be triggered when an entity #courses with either the value course or math is found.
In case the value of the entity courses is course but not math then the slot still needs to be filled and should prompt the user with 'Which specific course are you referring to?' since the slot is required. The problem I'm having is that the prompt is not getting triggered as shown in this image
So the entity courses with the value course is correctly identified but the prompt is not triggered.w
Am I missing something?
Edit
So modifying the configuration of the slot to add conditional responses I added a conditional response if the value of #courses:math is not found. Notice that I'm checking for the value of #courses:math on the black marked area but then I check on the conditional response if it is not found (red area) and if the value #courses:course is found and then the response should be triggered. So the conditional response should be something like
if #courses:course exists and #courses:math doesn't exist then
print "What specific course are you referring to?"
else if (#courses:course exists and #courses:math exists) or #courses:math exists then
do something else
But this is still not triggering any response for me.

You will need to configure the slot further.
Click the cog out to the side (between required and the trash can). You should see a modal appear that looks similar to the screen shot below. Click the dot dot dot menu at the top and click "Enable Conditional Responses". This will change the modal a bit so you can check the value of the entity. In the screenshot you can see I tested it, and the behavior appears to be what you are looking for.

Related

React Final Form: has a value existed?

How is it possible to check has a value already existed using React Final Form? I'm interested in the general approach. Also, be thankful for some links, etc, because could find nothing relevant.
Now details:
I have a form: a text input "User name" and a button "Submit".
I type a value (let say, "John") and press "Submit".
The value is saved into a database and becomes to display on my web page.
The input field is cleared and I am able to enter the new value.
I'm entering "John" again.
I should get an error message "Such name has already existed" once I moved the focus out of the field, or click on the "Submit" button.
You'd generally accomplish this by doing a preflight request to the server via fetch.
Send the field value(s) over whenever you do validation (e.g. on change or on blur) and have the server report back any issues (e.g. "Name already taken").
Implement some checking logic In the POST request. Before you write the logic to add the user to the database, check If a user with that username already exists, and If It does, return an error. It also depends on the database you are using how they handle searching for documents.
If its MongoDB you need to use the .find() method and find by username. If you find a matching username, return an error saying to enter a unique username.

IBM Watson Slots won't accept 0

I'm trying out the slots feature in IBM Watson Conversations and have hit an issue which I'm not sure how to work around.
I have a use case that is collecting a number of pieces of information from a user so using the Slots feature makes sense. Unfortunately when I add a Slot with #sys-number the system will not accept 0 as a valid input. This slot is in fact required but 0 is a valid value.
Anyone have an idea of how to have a required Slot of type #sys-number that accepts 0 as a value?
The condition #sys-number is in fact a short hand syntax for condition entities['sys-number'].value. When 0 is sent the condition is evaluated to false as 0 is treated as a false by the expression language evaluator in Watson Conversation Service. Now this is not a desired behavior in this case. To prevent this for happening one can use entities['sys-number'] in the condition that will return true every time #sys-number entity is recognized in the input.
When using this in slot one might want to edit what gets stored in the context variable as changing the condition will also change what is stored in the variable. This can be done by a JSON editor - click configure slot gear next to the slot specification and in the window that opens click three dots, open JSON editor and there change what gets actually stored inside the context variable that gets updated by the slot.
Here is a link to system entity section in Watson Conversation Service documentation.
I had a similar problem with recognising zero values in slots and the system entity documentation did not explain it well enough (for me at least).
Further elaborating on Michal's answer above:
Click the "Edit Slot" option (gear icon)
Set the "Check For" attribute on a slot condition as entities['sys-number']
Click the edit slot modal menu options (three bubbles in corner)
Open the JSON editor
Change the context variable value to "<?entities['sys-number'].value ?>"
Result:

How to change the default value of stage field

i am trying to change the default value of the Stage Standard Object at Opportunity
The steps i took :
Create a workflow rule with Rule Criteria
Opportunity: Created Date Not EQUAL To null
Evaluation Criteria Evaluate the rule when a record is created.
Add the action as a field update and select the value for the pick list
Activate the rule
but there is nothing happened as the default value remains -NONE-
What am i missing? As am new at salesforce also i don't wanna use trigger or buttons.
There is no option to make the stage field has a default value at the beginning unless you click on Save only in this case the value will be changed
and the steps will work correctly once you click on save button
The selected answer is correct, I've added a few links for anyone else looking for a solution to this issue. Hard to believe this is not standard functionality. Also don't hold your breathe, from the link at the bottom where the idea has been submitted it has been over 9 years and is still on the "PRODUCT TEAM REVIEW". Crazy.
Workarounds:
https://help.salesforce.com/HTViewSolution?id=000003628&language=en_US
https://success.salesforce.com/answers?id=90630000000i4HIAAY
Salesforce idea:
https://success.salesforce.com/ideaView?id=08730000000BrKdAAK

Display Alert box through the trigger - salesforce

Is it possible to display an alert message (not error message) through a trigger? I have written a trigger that checks for duplicate accounts in the system. The trigger at the moment gives an error message to the user telling that there is a duplicate account. But, if the user changes the value of a field "Is record near to duplicate?" to YES, the trigger allows the user to save the record.
But, I want to display the error message in an alert pop up box like "Account with this Name exists,are you sure you want to continue" and then user clicks Yes and the record gets created. Any thoughts on how I can do this. My code is below:
for(Account account: System.Trigger.New)
{
if(accountMap.containsKey(account.Physical_Street__c)==accountMap2.containsKey(account.Phone))
if(accountMap.containsKey(account.Physical_Street__c)==accountMap3.containsKey(account.Name))
if(account.Is_record_near_to_duplicate__c.equals('No'))
{
account.addError('Account with this Name,Street and Phone Number already exists. If you still wish to create the agency change the value of field "Is Record Near To Duplicate" to YES');
}
}
If you really need an alert box then you could create a custom javascript button that uses the ajax toolkit to replace the standard save button.
However, as Baxter said you are getting pretty far from standard salesforce look and feel. I would recommend instead to add an error on the checkbox field instead of the object so it is clear to the user what they need to select.
if(account.Is_record_near_to_duplicate__c.equals('No'))
{
account.Is_record_near_to_duplicate__c.addError('Agency with this Name, Physical Street and Phone Number already exists. If you still wish to create the agency change the value of field "Is Record Near To Duplicate" to YES');
}
Unless you write a custom visualforce page that processes the error message and then displays it as a popup there's no way to do this.
If you wanted the alert to modify the data you may look at using the ajax api to set the Is_record_near_to_duplicate__c field to 'Yes' but either way you're getting pretty far from the standard functionality and interface with this.
It is not straight forward to implement a pop-up alert for a trigger error, and pop-ups went out-of-fashion a long time ago. If you are going through the hassle, you might as well implement a custom soultion on a VF page.
Throw a custom exception(for dupe accounts) from the trigger, and catch it in your controller. When you catch this exception, you can dynamically displayed section on the page which asks the user to confirm his/her action. When the user confirms the action, the page will do the rest.
Hope this makes sense!
Anup

How to prefill a field of a node using rules in Drupal7?

Using rules it's easy to fill field values of a node after user pressed the save button. Just add a rule on before saving content event. But is it possible to have a rule to prefill a node field before edit form is shown to the user? So he has a change to corrent the default values.
This is a very late reply, but hopefully someone might find it to be of some help:
If you are creating the node using Rules, you could save it first, selecting "Force saving immediately: true". In the next step, you could set the value of the node field. You might need to save again. (also 'Force save' immediately.) And in the next step, do a 'page redirect' to the edit url.
Not sure if this is an elegant way to do it, but it might work. I had a somewhat similar requirement (not the same), and this is how I finally did that - by saving first, and then redirecting to the edit url of the saved node.
Not sure if this is something you can accomplish with rules or not, but if you go to structure->content types you can click "manage fields" and edit the default value of any field other than the title field (which you could always turn off and replace with a custom title field with a default value)
I think there are basically two ways of doing this:
1) Use Rules Forms. I don't know very much about that module, and I have had some less than perfect experiences with the module, but I'm fairly certain it could be done with the module.
2) Use Rules to create a node, populate the relevant field values, and then send the user to the edit page. One downside with this approach is that if the user decides to abort the node creation, you'll end up with a half-populated node that needs deletion in one way or another.
If you choose to go for option 2, and are comfortable with Page manager and Panels, it is probably worth checking out the Rules Panes module.

Resources