09-28-2011 09:15 PM - edited 03-14-2019 08:38 AM
Hey All,
I'm looking for help with the Create XML Document UCCX function. I need to reference a string variable as the Source Document as this step needs to to call different XML files dependent on what CTI RP the calls enters the Queue on.
I have looked at a couple of support discussions but the syntax used in these reply's doesn't appear to work.
Attached is a screen shot of the Create XML Document step as i have it configured so far.
Variables:
Name Type Value
pathDocumentApplication String "\HPC"
QueueSettings Document DOC[]
Any suggestions would be greatly appreciative!
Greg
09-29-2011 12:16 AM
Hi
My approach to this has been as follows:
String, parameter, sDocumentFilename
So sDocumentFilename is a simple String, and made a parameter enterable in the web UI. You would set this to "myfile.xml" or whatever is appropriate.
THen in the script:
set docWhatever = DOC[sDocumentFilename]
This correctly sets docWhatever to DOC[myfile.xml]
Presumably it's some hidden magic of the Document object/set step that makes it work like this rather than using the variable name of the string in the variable definition for the Document. If I understand what you are asking correctly :-)
Regards
Aaron
Please rate helpful posts..
09-29-2011 03:08 AM
Its sort of on the right track but what if you had your scenario described above but the sDocumentFilename myfile.xml needs to be a variable. For example if you had 10x myfileX.xml (X being a number from 0-9) files and you need them to be called as a DOC[]
From my experience I can't seem to get the following syntax to work: DOC["/en_AU/Folder1/myfile"+ documentNumber + ".xml]]
09-29-2011 03:26 AM
Hi Greg
So in your case you make up your string filename and assign it to a String var.
Then do a:
set yourDocumentVariable = DOC[StringVar]
Then use createXMLDocument on the yourdocumentvariable - rather than pointing the createXMLDocument step at a concatenation directly.
Trick is that you need to have that SET step... same applies even if you have a simple String (e.g. from an App Parameter) - you need the SET rather than just using DOC[strinvar] directly.
Aaron
09-29-2011 04:13 AM
Thanks Aaron, I will give that a go tomorrow and report back
09-29-2011 05:33 PM
I can't seem to get the script to call the StringVar.
I get the following error: As you can see the variable xmlNumberPilot does not appear to be able to populate the DOC[] variable
Have you got a working script for reference?
09-29-2011 09:28 PM
Try adding:
Set QueueSettings = DOC[xmlNumberPilot]
after your highlighted Set step.
10-08-2014 09:40 AM
I blew a few hours trying to get my variable document name to work before finding this thread. All good now. A very belated thanks to all of you.
Brian
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide