Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Expressions, Methods and Attributes in Architect - documentation?

    Posted 06-16-2022 11:34
    No replies, thread closed.
    Hi,

    OK, so I'm looking for the "missing link" in the documentation for Architect.

    In the Classroom Manual for the Beyond training it states "You can use expressions in the flow for complex decision making and formatting the customer inputs. A regular expression is a sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or with string matching, such as in find and replace operations. Genesys Cloud uses regular expressions to normalize phone addresses, classify calls, and format a phone number for display purposes.", which I know is confusing Expressions with Regular Expressions, but clearly implies the latter is possible.

    Later on the same page some examples are given that clearly treat some values as objects with methods and properties. For example:

    ToPhoneNumber(Call.Ani).dialingCode
    to extract the Dialing code from an inbound call.

    In the Resource center, Regular expressions are also mentioned for various purposes (mostly, to be fair in things like Dial Plans) but some in the context of Architect.

    Unfortunately, I can't find any comprehensive documentation of all data types and their methods / properties. (I found Phone Number, but can't find String, for example.)

    Specifically, what I am trying to do is to take a string that contains the forst line of an address and extract the numeric portion, if there is one. The key is "If there is one". If I take an address like "7601 Interactive Way", and use ToInt(), I get 7601. excellent. Unfortunately according to the documentation, if I were to try to do this for a value like "Indianapolis Office", it will generate an error. I cannot find a boolean function I can use to either test for an error, or test for a value being numeric (in which case, I could simply test the first character) so I figured Regular Expressions may be the way forward, however.. Now, sure, I could test the first character against each of the possible digit values, but that seems to be very long-winded and inefficient.

    So, can anyone point me at a comprehensive guide to Architect Expressions? (Or suggest a solution that doesn't involve writing a web service!)

    As always, TIA


    #ArchitectureandDesign


  • 2.  RE: Expressions, Methods and Attributes in Architect - documentation?

    Posted 06-16-2022 12:25
    No replies, thread closed.

    To see expression help: https://help.mypurecloud.com/articles/access-functions-help/

    To see all available data types: I would say look at https://help.mypurecloud.com/articles/update-data-action/ but that page needs updated.  In your flow add an update data action and you can see all the available types you can use.  For the types that have properties like phonenumber, create a dummy variable of that type, then open an expression somewhere and type the variable name followed by a period.  For example Task.phone.  The intellisense will display its properties.

    The only time you can do regular expressions in architect is with a slot type in a bot flow.  For any other case, you need to do string manipulation or your ToInt trick.

    There is an idea for regex support you can upvote: https://genesyscloud.aha.io/ideas/ideas/SSA-I-240

    Attaching an example common module flow that checks if a string is a street address and breaks it up into the number and the rest



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



  • 3.  RE: Expressions, Methods and Attributes in Architect - documentation?

    Posted 06-16-2022 17:03
    No replies, thread closed.
    For your specific example where you sometimes have a string "1234 Name Street" and sometimes just "Place Name" and you want the 1234 from the first and NotSet from the second...

    Regular expressions would help, but yes are not available in Architect Expressions. The first thing that comes to mind is you could do a boolean with the Contains function and check that it contains 1 or 2 or 3 or 4 etc. Not sure if a simple greater than or less than symbol will error with a string, but it is also worth a shot. 
    Otherwise you could feed it in to a Genesys bot, and have a slot setup with regular expression, and then just return the slot value back out and use that, which seems a little overkill to me.

    Just a couple of initial ideas, might come up with something better.

    ------------------------------
    Anton Vroon
    ------------------------------