Genesys Cloud - Main

 View Only
Discussion Thread View
Expand all | Collapse all

Searching list of keywords from a data table - Email routing

  • 1.  Searching list of keywords from a data table - Email routing

    Posted 03-06-2020 13:20
    I have a requirement to manage a list of keywords to search in the subject or body of an email from a data table so this can be easily updated by the end user without editing the email flow in Architect.

    I've tried the following.

    Creating a data table with a column for each key word and then using an expression contains(email.message.body,flow.word1) or expression contains(email.message.body,flow.word2)

    Data Table
    This works but I have to account for blank data and I have to fix the number of words available.

    I also tried something a bit odd which was adding an expression inside a string to use. This had two issues. 1 is that quotes were modified to  \" and as far as I can see when I used a combination of the two so replaced the quotes with flow.word1 it still failed so I assume this is not possible.

    Data Table 2

    Has any one come up with a way to achieve this? I've looked at makelist but I don't think that will work in this case. My other option is to send the email body or subject to an external service possibly by lambda to Amazon Comprehend.
    #DigitalChannels
    #Routing(ACD/IVR)

    ------------------------------
    Richard Chandler
    Conn3ct
    ------------------------------


  • 2.  RE: Searching list of keywords from a data table - Email routing

    Posted 03-07-2020 14:27
    My choice would be a list of words divided by a pipe and then use a loop in the Email flow to parse through the pipe-delimited field a word at a time with the same search parameter each time until you are out of words.  Saves worrying about blank fields or adding fields and allows any number of words to be used.  

    So you would have:

    Sales                    Sales|Richard|Mark|ETC                           This is my custom autoreply



    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: Searching list of keywords from a data table - Email routing

    Posted 03-09-2020 05:49
    Thanks Robert,

    Can you please share a copy of the makelist, count and contains expressions used please?

    ------------------------------
    Richard Chandler
    G3 Comms Ltd
    ------------------------------



  • 4.  RE: Searching list of keywords from a data table - Email routing

    Posted 05-17-2020 08:42
    hi there, 
    please advise if you have received the below and if you managed to get this working as i am faced with same issue?

    Can you please share a copy of the makelist, count and contains expressions used please?

    ------------------------------
    Reginald Sheraton
    Bytes Systems Integration a Division of Altron
    ------------------------------



  • 5.  RE: Searching list of keywords from a data table - Email routing

    Posted 05-17-2020 15:19
    Edited by Robert Wakefield-Carl 05-17-2020 15:23
    When you read in the Data Table, you will get a string.   You use the Make List - MakeList(DataTableLookup) - to split that string into multiple elements in a collection and then use Count(ConnectionName) to get the number of elements in the collection.  








    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 6.  RE: Searching list of keywords from a data table - Email routing

    Posted 06-11-2021 06:30
    Edited by Asad Saqlain 06-11-2021 07:40
    Hi Robert or other intellectuals,

    Good idea. I've tried this but my pipe delimited keywords e.g. Sales|HR|Cars are apperantly not being parsed or something is not good with loop.


    Here below my decision statements. Also Keywords are being found but i think not parsed or loop is failing.

    Contains(Email.Message.subject, GetAt(State.CollectionKeywords, State.CollectionCount), true)
    Or
    Contains(Email.Message.body, GetAt(State.CollectionKeywords, State.CollectionCount), true)

    Thanking you in advance.

    #Architecture and Design
    ------------------------------
    Asad Saqlain
    ------------------------------



  • 7.  RE: Searching list of keywords from a data table - Email routing

    Posted 06-11-2021 18:25
    Hi,

    I've found/fixed the issue. I needed to use split to parse the pipe and everything went fine. 

    KR,

    ------------------------------
    Asad Saqlain
    Frontline Solutions
    ------------------------------



  • 8.  RE: Searching list of keywords from a data table - Email routing

    Posted 06-11-2021 18:39
    Beat me to it.  Yes, you need to use the Split on the string to get the collection.

    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 9.  RE: Searching list of keywords from a data table - Email routing

    Posted 06-14-2021 15:03
    I've done a similar application using a data table lookup.  I put the lookup inside a loop, set my max loop count to 99, then use the value of my loop counter as the key value in my data table (0,1,2, etc).  In the case, my found path send an auto respone, my not found path exits the loop and moves on to whatever is next.  Works great as long as you have less than 101 key words/phrases to look up.  Easy for the customer to update/maintain the key words.

    ------------------------------
    Mike Steinke
    Inflow Communications
    ------------------------------



  • 10.  RE: Searching list of keywords from a data table - Email routing

    Posted 08-27-2021 06:54
    Hi Asad,

    I have the same requirement to look for different keywords in a data table which I want to check step by step using a loop.
    I assume I have created a flow with your mentioned steps but it is not working.
    Where exactly did you use the split() function? In the MakeList() or in Decision?
    My data table looks like that one
    keywords                  buzzwords
    <myKeyword>          word1|word2|word3

    My MakeList looks like that.
    MakeList(ToString(Split(State.keywords,"|")))

    Decision: Contains(Email.Message.subject, GetAt(State.collectionKeywords, State.collectionCount), true)

    My problem is that my variable State.collectionCount is only "1"​ although I have 3 words pipe seperated in my data table.
    Why doesn't work the update data "collectionCount" = Count(State.collectionKeywords) ?

    How did you configure the loop? your provided configuration should work only once, isn't it?
    I have configured my loop step as follows.


    Is this correct or should I rather set the Max loop Count = State.collectionCount

    Thanks in advance!
    Tobias

    ------------------------------
    Tobias Junghans
    NTT Germany AG & Co. KG
    ------------------------------



  • 11.  RE: Searching list of keywords from a data table - Email routing

    Posted 08-27-2021 07:10
    Hi there

    It looks like your makelist statement is incorrect. try simply split(state.keywords,"|") without the tostring or makelist.

    If your data needed to be converted to strings it would be split(tostring(state.keywords),"|")

    In these scenarios its often worth adding your data to SET PARTICIPANT DATA so you can see what it stored.

    ------------------------------
    Richard Chandler
    Connect
    ------------------------------



  • 12.  RE: Searching list of keywords from a data table - Email routing

    Posted 08-27-2021 07:11

    Hi Tobias,

    You don't need to use makelist for. Split(State.Keywords, "|") should work fine. And yes indeed you need to use variable Count(State.CollectionKeywords) as a max loop count.

    My decision looks like, where i'm using Trim(State.CollectionKeywords[State.Index]) to get the index value of a keyword: 

    If(IsSet(Email.Message.subject), Contains(Email.Message.subject, Trim(State.CollectionKeywords[State.Index]), true), false)
    Or
    If(IsSet(Email.Message.body), Contains(Email.Message.body, Trim(State.CollectionKeywords[State.Index]), true), false)

    I guess this should help to get things working otherwise let me know and I can help further :).




    ------------------------------
    Kind regards,

    Asad Saqlain
    ------------------------------



  • 13.  RE: Searching list of keywords from a data table - Email routing

    Posted 08-27-2021 09:43
    Hi Asad,
    what do you mean by State.Index? in the desicion element?

    If(IsSet(Email.Message.subject), Contains(Email.Message.subject, Trim(State.collectionKeywords[State.Index]), true), false)
    Or
    If(IsSet(Email.Message.body), Contains(Email.Message.body, Trim(State.collectionKeywords[State.Index]), true), false)

    What do you think about my variable Count(State.CollectionKeywords) is set to 1 instead of 3?

    Cheers,
    Tobias

    ------------------------------
    Tobias Junghans
    NTT Germany AG & Co. KG
    ------------------------------



  • 14.  RE: Searching list of keywords from a data table - Email routing

    Posted 08-27-2021 16:08
    Hij Tobias,

    State.index is loop count (position of keyword at that count moment) from collection variable.



    ------------------------------
    Kind regards,

    Asad Saqlain
    ------------------------------



  • 15.  RE: Searching list of keywords from a data table - Email routing

    NEW MEMBER
    Posted 28 days ago
    Edited by Nissin Kunjumon 28 days ago

    Hello Asad, 

    What if we have a requirement to identify keywords separately and route them to different ACD queue accoridngly. 

    For example: If in the email body or email subject, if the keyword contains car, automobile, scooter (similar other keywords) then it has to go to the automobile queries queue OR If in the email body or email subject, if the keyword contains claim, reimburse, repay (similar other keywords) then it has to go to the claims queries queue. How exactly can we do this using data table and by keeping the design simple.



    ------------------------------
    Nissin Kunjumon
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources