Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Capitalise Slot/Variable for script

    Posted 12 hours ago

    Hi

    I'm using an AI agent to collect customer details to pass into an agent script.  The native results pass in all lower case and I can capitalise all by using upper(Flow.x) but cant get the correct syntax to capitalise the first letter using the usual 0,1 after the variable.  Is this at all possible please


    #Architect
    #Scripts

    ------------------------------
    Philip Thys
    3rd Line Engineering Specialist
    ------------------------------


  • 2.  RE: Capitalise Slot/Variable for script

    Posted 9 hours ago

    Hi Philip,

    Yes, this is possible. I tested it in Architect using Substring() and Upper().

    If your slot value is stored in Task.text, the following expression capitalizes just the first letter while leaving the rest of the text unchanged:

    Upper(Substring(Task.text, 0, 1)) + Substring(Task.text, 1, Length(Task.text) - 1)

    It works by:

    • Substring(Task.text, 0, 1) extracts the first character.
    • Upper(...) converts that character to uppercase.
    • Substring(Task.text, 1, Length(Task.text) - 1) returns the remainder of the text.
    • The + concatenates the two parts together.

    For example:

    • softwareSoftware
    • johnJohn

    This worked in my testing. If you need to capitalize every word (for example, john smithJohn Smith), that would require a different approach.

    Hope this helps.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------



  • 3.  RE: Capitalise Slot/Variable for script

    Posted 8 hours ago

    General


    Magic, I'll give that a go

     

    Philip Thys
    3rd Line Voice Engineering Specialist
    Enterprise Managed Services, Enterprise

    T: +44 3316240050
    M: +44 7545 130286

     

     

    Enterprise: a new BT that really means business

     


    General