Interesting...
Original Message:
Sent: 08-16-2023 08:16
From: Sean McGrath
Subject: Escaping characters in Participant Data
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
Original Message:
Sent: 08-15-2023 07:44
From: Paul Simpson
Subject: Escaping characters in Participant Data
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
Original Message:
Sent: 08-15-2023 06:28
From: Waqar Mahmood
Subject: Escaping characters in Participant Data
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.
Original Message:
Sent: 08-14-2023 11:47
From: Paul Simpson
Subject: Escaping characters in Participant Data
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
------------------------------