UCCX - Using the DOC variable

Unanswered Question
Dec 2nd, 2009

Hello all,


I am trying to use the DOC variable to do a GET XML. In my GET XML I specify a variable for the Document field.


In the DOC variable I want to use the value such that DOC[variable + "filename.xml"] where variable is a directory specified as "Files\".


When I debug the script it cannot complete the GET XML step because it can't find the file at location "Files\filename.xml".  What am I doing wrong?


Thanks,

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Jonathan Schulenberg Wed, 12/02/2009 - 11:48

The document repository uses a forward slash for starters: DOC[Files/filename.xml]


Besides that, ensure that you are specifying this in the Source Document parameter.

csg-admin Thu, 12/03/2009 - 07:48

I couldn't get this to work.


So I tried this instead:


Create File Document Filename=filedir + "\" + filename | Document = xmlMotd   (filedir and filename are string variables)

Create XML Document Source Document=xmlMotd | Document=xmlMotdDoc

Get XML Document Date Document=xmlMotdDoc | XML Path:"a valid xml file on the server" | Result Data=xmlMotdGet



When I run the debug the xmlMotd variable gets the right path to the file \de_DE\IT\motd.xml (the actual location of the file on the server is c:\program files\wfavvid\Documents\user\de_DE\IT\motd.xml.  However, the script fails and the debug tells me "the system cannot find the path specified".


Am I using the right approach to find and read an xml file on the server whose name and location are build up using script vaiables or must I always hard code the location of the file in the script?


Thanks,

Jonathan Schulenberg Thu, 12/03/2009 - 10:07

The first thing that stands out to me is that you should not be referencing the local file system or using the Create File Document step. Your XML file needs to be in the Document Repository which you upload through /appadmin. This is synchronized to the disk from the database automatically for you.


The Create XML Document step has three parameters. They should look something like this:

Source Document:  DOC[xmlDocumentsUrl + xmlFilename]

Where xmlDocumentsUrl would be the folder within the document repository and xmlFilename is the actual file.

When the engine processes this, it will look something like this DOC[example\filename.xml]. Remember that this is inside the default language unless you qualify it with a language qualifier: DOC[example\filename.xml] @ L[de_DE]

Source ID:

Document: YOURDOCVARIABLE

This should be a Document type variable.


The parameters for your Get XML Document Data steps should look something like this:

Document YOURDOCVARAIBLE

XML Path: "/example_root/next/etc"

Xpath is very flexible. You should look at the W3C or W3Schools references for additional information.

Result Data: YOURSTRINGVARIABLE

Where you want the result stored.

Abdulbaseer Mohammed Thu, 12/03/2009 - 17:05

upload your script we can see more cleary.  are you really calling file name as filename?  You are in the direction except few small checks like forward slash etc. Do you have all the steps required like create file document, create xml and then get xml.....


F1- Help and few scripts are helpful as well.

Actions

This Discussion