
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 06:38 AM
Hi Team,
Can you guide me how to create a JSON in UCCX script.
Regards,
Jijesh
Solved! Go to Solution.
- Labels:
-
UCCX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2023 07:40 AM - edited 06-04-2023 08:01 AM
I took you result from the REST call and created this simple script to get the value that you have asked about.
There are a few things with your result from the REST call that makes it not work with what I suggested.
- Your result is in-between angle brackets and that makes it an array in JSON
- Your vip value is formatted as a string as it is in-between double quotes
In my script that tried to attach, but I just get "Sorry, unable to complete the action you requested." I added two set steps that does this.
- First one removes the angle brackets from the result string
- Second one sets the boVIP boolean variable based on the strVIP string variable
There are for sure cleaner ways to do this, but I’m not that great with the expression language and I’m for sure not a Java programmer. So I did it the simplest way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2023 12:21 PM
Thanks for helping to finish this steps. I done the voting
Call flow not completed. I will give you the update once I started the new steps.
Jijesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 06:55 AM
Crate string variable INC with string “INC”. Then when you get the digits do a set variable INC = INC+DigitsVar.
david
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 07:57 AM
Can you please be a little more specific about what you'd want to accomplish?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 09:54 AM - edited 05-29-2023 09:56 AM
We need to build a call flow.
Step1. user will enter the employee ID then we need to validate the Employee ID , Incident number and Task . So we received the service now Api for Employee ID validation and tickets. validation.
I created the MAKE REST CALL and tested the employee ID's are fectching . It is working fine.
Next I need to create JSON so need a advice or help .
Regards,
Jijesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 10:33 AM - edited 05-29-2023 10:33 AM
You’re still not very specific. Create JSON from what or with what?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 11:59 PM - edited 05-30-2023 12:01 AM
I will explain the call flow.
When customer calling the queue number first it will ask the employee ID to enter once they enter the number, need to validate employee number, then it will go another prompt press 1 for incident 2 task. Once the ticket number validation completed. - Call should sent to Agents directly with service now ticket page popup.
We have a received the api details to validate the employee number
Attaching the Script screen shot which I created for your reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 12:49 AM
What should you send to ServiceNow (Values and syntax))
What is your expected response?
Have you tested it in Postman?
Thanks, Thomas G. J.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 01:43 AM
Expected Behaviour is once user enter the employee ID it needs to be validated once it verified we should ask to enter the incident number or task again we need to validate the number though service now via api.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 04:29 AM
This is what we did for ServiceNow when we used CCX.
It's slightly different then you're requirement, but it should give you an idea on how it could be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 06:47 AM
I am attaching the REST Call properties as well as successful calls once I entered the digit.
What is the variable need to be create for JSON document.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 08:08 AM
Some additional details
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 01:09 AM - edited 05-31-2023 01:29 AM
Thanks for sharing the information.
I have created the JSON document and tested the script and getting the status code "200". I am attaching the screen shot can you confirm whether it is a expected behavior.
Jijesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 03:44 AM
Status code in the 2xx range means successful. Are you getting the JSON document populated with data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 05:19 AM
I am getting the JSON document populated and but there is no data. I attached the screen shot already with 200 message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 05:32 AM - edited 06-04-2023 06:29 AM
You should not have the TEXT[variable] in the document variable as you have it in this screenshot.
That should be used in the Create JSON document step to populate it with the response value you get from the REST call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 05:56 AM
I have created the response string . Screen shot below.
Getting the Response is U "{\"result\"[]}". Screen Shot below
Below variable created for JSON.
JSON properties screen shot below Do we need to create separate string for Source document. Which one I need to use it
