Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Expression builder in Architect

    Posted 08-06-2024 14:06
    No replies, thread closed.

    Hi all,

    is there any way to build complex expressions just like we did in Designer using ECMA script?

    I'm talking about loops, string regexp replace, switch constructions, etc.

    Thanks


    #ArchitectureandDesign

    ------------------------------
    Vitalii Hetman
    Miratech, Inc
    ------------------------------


  • 2.  RE: Expression builder in Architect

    Posted 08-07-2024 02:25
    No replies, thread closed.

    Hi Vitalii,

    architect supports loops (Loop action - Genesys Cloud Resource Center (mypurecloud.com)) and switches (Switch action - Genesys Cloud Resource Center (mypurecloud.com)). They are pretty easy to understand. I never used RegEx in Architect and do not think, that there is a native function for that. But you could check the "expression help" aviable in architect for string manipulation. (Click the "f(x)"-Button. Its aviable everywhere you can create an expression).

    Best
    Christoph



    ------------------------------
    Christoph Domaschke
    CRONBANK AG
    ------------------------------



  • 3.  RE: Expression builder in Architect

    Posted 08-07-2024 03:36
    No replies, thread closed.

    Hi Christoph,

    thanks for your response! Yes, I aware about all those features available, I'm more curious about the features in expression editor.

    For example if I want to split caller utterance by word (length is unknown at this point) and then iterate through all splitted groups to do specific operations with each word.

    something like

    varUtterance = Split(varUtterance, " ")

    varLength = Count(varUtterance);

    for (var i = 0; i<varLength; i++){

       if(Length(varUtterance[i]) != 10){

           varFlag = false;

       }

    }



    ------------------------------
    Vitalii Hetman
    Miratech, Inc
    ------------------------------



  • 4.  RE: Expression builder in Architect
    Best Answer

    Posted 08-07-2024 10:51
    No replies, thread closed.



    ------------------------------
    Melissa Bailey
    Genesys - Employees
    ------------------------------



  • 5.  RE: Expression builder in Architect

    Posted 08-07-2024 10:58
    No replies, thread closed.

    Hi Melissa,

    thank you! I see that it is possible to do using existing blocks, but no way to build long custom code - I guess that was done to control user input and functions that are used to reduce number of errors developer might do.



    ------------------------------
    Vitalii Hetman
    Miratech, Inc
    ------------------------------



  • 6.  RE: Expression builder in Architect

    Posted 08-08-2024 14:24
    No replies, thread closed.

    Vitalii,

    The "code" that you are looking at is an Expression, not a subroutine. It's like a formula in Excel. It simply generates a value of the required type - it can be quite complex, but at the end of the day, it has a value. In Architect, there isn't a way to write code using something that looks similar to a programming language like JavaScript, Python or C.

    HTH



    ------------------------------
    Paul Simpson
    Views expressed are my own and do not necessarily reflect those of my employer.
    ------------------------------



  • 7.  RE: Expression builder in Architect

    Posted 08-28-2024 23:17
    No replies, thread closed.

    Melissa's suggestion is spot on.  In the bot flow you can capture Session.LastCollectionUtterance and split into a collection (array) for ingestion/manipulation.  Depending on what you're trying to accomplish, you might subsequently find the Find, GetAt, & Replace functions accomplish what you're after.



    ------------------------------
    Jason Rottero, GCP
    Wildcard Technology, Inc
    ------------------------------