cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3739
Views
5
Helpful
7
Replies

How to Modify XML document through UCCX script

Hello All,

I have uploaded one XML document in UCCX 11.6 default path.

Now I want to modify the XML file through UCCX script. 

In the recording script where options are “Press 1 to activate, Press 2 to deactivate and press 3 to record. Press 3 options is working fine. Now press 1 and press 2 can we create a xml document and modify the value inside the XML document. For example if I want to change the ActivationStatus  in below file to "False" how to do that with UCCX script. 

Capture.JPG

 

 

7 Replies 7

Mike_Brezicky
Cisco Employee
Cisco Employee

I have a similar function where my Call Center is able to call in and set their queues to emergency.

1 - Create XML doc from existing XML

2 - Transform values based on variable (in this case, pressing 1 sets emergencyStatus to true, and "True" is set in the xml)

3 - Upload document back to CCX.

EmergencyMode.JPG

 

I assume you should be able to work out something similar for your needs.

Hi Mike, Thanks for your reply. I tried the upload step, but only blank document get uploaded.

I would like to know whether my script configuration is fine or not.

Below is my Template, I would like the change the value "%Manual%" to True of False.

Capture1.JPG

Screenshot of my Script.

Capture.JPG

Please help me as I am stuck at this point from last one month. TAC also not providing any solution as TAC is not responsible for any new configuration.

Lets see what we can do.

1 - XMLActivationStatus = Create XML Document
- Make sure the initial value is set to the actual document DOC[XMLActivationStatus.xml] or else it will just create a blank doc instead of pulling down the existing file.
- Remve the PressForRecord - the source ID can just be blank for simplicity.
2 - XMLActivationStatusTemplate
- Again, make sure the initial value is linke to the actual template doc.
My template is a simple file with the following:
<Emergencys>
<Emergency>%value%</Emergency>
</Emergencys>
In the Transform properties, Keyword Template = template file, Document = XMLActivationStatus doc, Keywords - Names: "Value", Values: ActivationStatus.

This will take the template, replace %value% with the string from Activation Status and within the script generate a new file named ActivationStatus.xml.

Then, change your upload lone to the ActivationStatus.xml, not the template.

Thanks again for your prompt reply.

I tried as per your suggestion but again blank file get uploaded. There may be something wrong in my configuration. Either in the Variable or in the script. When I enabled reactive debug everything seems to be right. However still blank file get uploaded. Any Idea what is wrong in my configuration. Activation.JPG 

ActivationStatus variable should be a string with just the text false, not an actual boolean value
XMLActivationStatus , Create XML should not be the actual XML, but DOC[XMLActivationStatus.xml] - a reference to the doc already uploaded to CCX.
Same for the template, you should have a copy of the XMLActivationStatus.xml, but with %value% in the ActivationStatus tag. That way when you perform the transform, it knows where to place the variable.

Hello Mike,

Im working on setting up this exact scenario. 

Would it be possible for you to upload the UCCX script you had success with in this scenario?

Im having an issue with the upload document step and would love to be able to work off of yours. 

 

Thanks,

Tim

Hi, Though this is an old thread, i have tried this now and replying with my worked script for future reference.

Hope this image explains.

I am uploading OriginalXML as OriginalXML1 to avoid confusion, we can use same name as OriginalXML for uploading document, no issues.

Authenticate the user with credentails having admin rights. Enter the user name and its corresponding password.