AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Advanced Wildcard Help
 
 

I am working on a trigger to take input and send an email based on that input. One problem I am running into is being able to get more than one string in a wild card. Example of the trigger I am trying to do is:

send an email too * subject * body *

if i want the subject to be something like “thank you for your time” I only get “thank”. I have also tried to get the user input into a python object and parse it there, but I cannot seem to figure out how to do that either. Any help would be greatly appreciated.

 

 
  [ # 1 ]

Could you give an example of what the human would say to activate your category please?

 

 
  [ # 2 ]

An example would be

send an email to .(JavaScript must be enabled to view this email address) subject hello this is a test body hi how are you today?

i would like the wildcard to grab “hello this is a test” and the second wildcard would be “hi how are you today?”

Currently it is grabbing “hello” and “hi”. From my research I cannot see a way to have a wild card grab more than one word. I also cannot seem to figure out how to grab the entire user input. I have tried the <input> tag but that showed up as undefined.

 

 
  [ # 3 ]

So after some more testing I have found that the RiveScript variables are working but when I send it to the python object and use the args it splits each word into its own index, args[0] = first word args[1] = second word etc.

No way to determine where the subject ends and body begins…..


UPDATE:

I included a special character in my response call, in my case “|”. Within the python object I created a loop that goes through all the args and creates a “To”, “Subject”, and “Body” string; separated by my special character. Code below for anyone that happens to run into this issue as well.

em = [”“, “”, “”]    # BLANK LIST TO HOLD THE “TO” “SUBJECT” & “BODY”
ind = 0           # VARIABLE TO HOLD THE CURRENT INDEX OF THE EM LIST
for a in range(len(args)):    # LOOP THROUGH THE ARGS
if args[a] != “|”:      # IF NOT SPECIAL CHARACTER CONCATENATE INTO ONE STRING
  em[ind] = em[ind] + args[a] + ” “
else:                  # IF SPECIAL CHARACTER GO TO NEXT INDEX IN LIST
  ind = ind + 1

# NOT NECESSARY BUT I LIKE MY VARIABLES TO READABLE  
sendTo = em[0][:-1]
sendSub = em[1][:-1]
sendBdy = em[2][:-1]

 

 
  login or register to react