Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Escaping characters in Participant Data

    Posted 08-14-2023 11:48
    No replies, thread closed.

    Hi,

    Odd one for you!

    I have a Common Module that appends to a Participant Data attribute, which I use for logging. What it does is to retrieve the current value of the attribute, then if that attribute already contains data, it appends a carriage return / line feed sequence, before adding a timestamp and the new message (which is passed in). If it doesn't already contain data, then it simply creates it with the timestamp and the new message.  Finally, it writes the revised attribute back.

    All of this works. Nearly. For some reason, even though I am including the "\n\r" string in the appended version (and I've also attempted to add "\t" between the timestamp and the message) these escaped characters do not appear to be being written back to the Participant Data action! The rest of the text is there, but is comes out as a single string, all on one line when I look at the interaction details. I've even tried copying the text into Notepad to see if the characters are there, just not being honored, but no joy there either.

    So, anyone here able to figure out what I am doing wrong?

    TIA


    #ArchitectureandDesign
    #SystemAdministration

    ------------------------------
    Paul Simpson
    Eventus Solutions Group
    ------------------------------


  • 2.  RE: Escaping characters in Participant Data
    Best Answer

    Posted 08-15-2023 06:29
    No replies, thread closed.

    Hi there,

    We use a similar approach for our logging: a common module that (1) fetches the value of participant data, (2) appends a string at the end of its existing content, and (3) writes the updated string to the participant data.

    Our expression to update the participant data is:
    Task.existingValue + Common.SectionName + " : " + Common.newString + "\n"
     
    An example expression used to create Common.newString is:
    "\n\tChecking if new number was dialed" + 
    "\n\t\tCalledAddressOriginal [" + Call.CalledAddressOriginal + "]"
    What we see in the log looks like:
    Some Section Name : 
        Checking if new number was dialed
            CalledAddressOriginal [+123456789]

    We see the new lines and tabs only if we click on the copy icon (which appears at the top left of the content of the participant data when you hover over it) in the Interaction Details and paste the contents into Notepad++. We do not see the formatting in the Interaction Details page when we expand the contents of the participant data. We do not see the formatting if we copy by manually selecting the contents of the participant data using the mouse.



    ------------------------------
    Waqar Mahmood
    Herbalife International of America, Inc.
    ------------------------------



  • 3.  RE: Escaping characters in Participant Data

    Posted 08-15-2023 07:44
    No replies, thread closed.

    Thank you!

    This has been driving me crazy 🤬 I've been swapping around the "\r\n", assigning to a variable first and all sorts!

    Quick question (for you or anyone else with knowledge of these things). I see you are using "+" to concatenate strings, I tend to use Append(). Is there a performance / functional difference between the two?

    i.e. is

    "Hello "+"World"

    preferable to

    Append("Hello ", "World")


    ------------------------------
    Paul Simpson
    Eventus Solutions Group
    ------------------------------



  • 4.  RE: Escaping characters in Participant Data

    Posted 08-16-2023 08:16
    No replies, thread closed.

    Append() has less overhead than using +. I also prefer Append() because it can handle NOT_SET. So if you have Append("Some String ",Flow.Variable) and the variable has a value of NOT_SET then the Append() won't crash your flow.



    ------------------------------
    Sean McGrath
    TTEC Digital, LLC fka Avtex Solutions, LLC
    ------------------------------



  • 5.  RE: Escaping characters in Participant Data

    Posted 08-16-2023 12:08
    No replies, thread closed.

    Thanks, Sean!

    Interesting...



    ------------------------------
    Paul Simpson
    Eventus Solutions Group
    ------------------------------