Author Topic: Line Feed in attached data  (Read 2996 times)

Offline mduran22

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
Line Feed in attached data
« on: July 26, 2014, 05:09:05 PM »
I am looking for a way to create a line feed in attached data through the IRD attach/update function.

Context: We have a soft phone with a text box for free form notes. This text box is usually updated by agents and corresponds to a  KVP (Notes:[text]). Each time a new note is added the soft phone takes the current text, inserts two line feeds, and puts the new note at the top of the text box.

I am trying to find a way within the attach/update function in IRD to do the same when the call is transferred back through a strategy. I have tried using some text editors to create text samples with the line feeds and copy and paste it into the function. It appears to keep the line feeds but when I click OK and reopen the function it squishes (technical term) the first line and second line together.

I could just put a delimiter in between the notes and just have the soft phone parse it, but I would prefer to do this in the strategy and have the KVP reflect the line feeds (logs, etc).

Has any one accomplished this before or have any ideas?

Example below.

Call has routed to agent 1. Agent 1 types a note and transfers directly to agent 2 who types a note. The soft phone prepends the agent name and date/time and and puts two lines feeds between the new note and first note:

[u]Text Box[/u]___________________________________________________________
Note 2 some info about the call. added by agent 2 on 7/26/2014 12:34

Note 1 some info about the call. added by agaent 1 on 7/26/2014 12:30
__________________________________________________________________

Agent 2 routes the call back through a routepoint to a different group, which goes through a strategy which adds a note, identifies it is from router, puts date/time, two lines feeds and the original text.

[u]Text Box[/u]___________________________________________________________
Note 3 some text about the call. added by Router on 7/26/2014 12:39

Note 2 some text about the call. added by agent 2 on 7/26/2014 12:34

Note 1 some text about the call. added by agaent 1 on 7/26/2014 12:30
__________________________________________________________________

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Line Feed in attached data
« Reply #1 on: July 26, 2014, 07:16:25 PM »
Maybe you could test with GAD and see how it sends it as it also uses the notes concept. Copy and improve ;)

Offline terry

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 35
Re: Line Feed in attached data
« Reply #2 on: July 26, 2014, 08:09:28 PM »
Function Char[variable number of integers interpreted as chars ASCII codes] returns string consitiong from those ASCII codes.
If you need string like CR LF CR LF then Char[13,10,13,10] will do it and it can be inserted between other strings.
Attach[Notes, Cat[Note1, Char[13,10,13,10], Note2, Char[13,10,13,10], Note3]]

Offline mduran22

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
Re: Line Feed in attached data
« Reply #3 on: July 27, 2014, 09:14:40 PM »
Cav, support suggested something similar (after initially telling me it wasn't possible to have breaks in KVP values) in using the code in our soft phone. In our soft phone the notes function uses string builders class and the append line function, which of course can't be used in IRD. I haven't worked with GAD specifically (worked with IW) but I would think the same would be true, although I believe composer opens up routing functions to other languages.

Terry,

Thank you! That is exactly what I was looking for. I had found a post about classification server using the ASCII control codes in classification server and tried to use it in IRD which took but I was only using char[10] or char[13] which instead of using them in combination of char[10], char[13],char[10],char[13], although I supposed I could just use char[10],char[10], char[13]. I also added a check to see if the "Notes" key was null before using the update function with the line feeds so I didn't get extra line spaces in the KVP and Text box if they weren't necessary.

I looked through KB and documentation and couldn't find anything on the char[] function to use ASCII codes. So I am guessing this is an undocumented function?

Thanks both,
Mike

Offline terry

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 35
Re: Line Feed in attached data
« Reply #4 on: July 27, 2014, 11:03:16 PM »
Depends how you define "documented function".
If as function present in ref manual - probably yes.
If as function present in compiler.dat file (it is going with IRD installation and describe all functions that IRD (and matched URS) understands) - probably no.


Offline mduran22

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
Re: Line Feed in attached data
« Reply #5 on: July 28, 2014, 10:18:49 PM »
Documented like the other functions as...in a document or help file describing features and usage, in a Knowledge base, or something support would be able to find :).

I wasn't aware of the compiler.dat file, but I did that Char in there, although it doesn't show up in function block of IRD. The definition is a little vague and doesn't say specifically that the codes are ASCII and that control codes can be used, at least in my version.

It would be great if the person responsible for maintaining those definitions in that file would add something like that. I'm sure he must be a nice guy ;)