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.
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.
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.
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.
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
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
05-29-2023 07:57 AM
Can you please be a little more specific about what you'd want to accomplish?
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
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?
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.
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?
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.
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.
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.
05-30-2023 08:08 AM
Some additional details
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
05-31-2023 03:44 AM
Status code in the 2xx range means successful. Are you getting the JSON document populated with data?
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.
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.
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
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