Through other posts I figured out how to write a script in CRS 4.0 that allows callers to enter an account number which gets stored in a CSV file on the server. I am using Get Digit String to collect the account number then writing to the file using the Write Document step. The problem is that I need to keep all account numbers entered in the file. In my current script the number gets over written every time a new caller enters an account number. How do I set this up to retain every account number entered by each caller? Thanks for the help!!
I was recalling it from memory. I tested it on my lab box and the syntax to recast the document to a string variable is (String)myDocumentVariable
You will also need to use the + rather than & to concatenate the variables.
You can do something like this:
1) Use the create document step to pull the existing csv file into a document variable.
2) Use the set step to "cast" that document variable with the csv file into a sctring variable. You do this by using the toString method. myDocumentVar.toString()
3) Append the account number to the string variable using the set step. myStringVar & myAccountNumVar
4) Use the write document step to save the new doc.
Since the file is pulled for each call, you may end up with some missing account numbers when multiple callers call in at the same time.