cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4964
Views
15
Helpful
52
Replies

JSON in UCCX Script

Hi Team,

 

Can you guide me how to create a JSON in UCCX script.

 

Regards,

 

Jijesh

3 Accepted Solutions

Accepted Solutions

I took you result from the REST call and created this simple script to get the value that you have asked about.

Snag_278167.png

There are a few things with your result from the REST call that makes it not work with what I suggested.

  1. Your result is in-between angle brackets and that makes it an array in JSON
  2. 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.

  1. First one removes the angle brackets from the result string
  2. 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.



Response Signature


View solution in original post

@Roger Kallberg

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

View solution in original post

Crate string variable INC with string “INC”. Then when you get the digits do a set variable INC = INC+DigitsVar.

david

View solution in original post

52 Replies 52

Can you please be a little more specific about what you'd want to accomplish?



Response Signature


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

 

 

You’re still not very specific. Create JSON from what or with what?



Response Signature


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.

 

 

 

 

What should you send to ServiceNow  (Values and syntax))

What is your expected response?

Have you tested it in Postman?

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

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.

This is what we did for ServiceNow when we used CCX.

Snag_1041e83.png

It's slightly different then you're requirement, but it should give you an idea on how it could be done.



Response Signature


@Roger Kallberg 

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.

 

Some additional details

image.pngimage.pngimage.png



Response Signature


@Roger Kallberg 

 

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

Jijesh_0-1685521744651.png

 

 

 

Status code in the 2xx range means successful. Are you getting the JSON document populated with data?



Response Signature


@Roger Kallberg 

I am getting the  JSON document populated and but there is no data. I attached the screen shot already with 200 message.

Jijesh_0-1685535421307.png

Jijesh_1-1685535480069.pngJijesh_2-1685535543128.png

 

 

 

You should not have the TEXT[variable] in the document variable as you have it in this screenshot.

IMG_4302.jpeg

That should be used in the Create JSON document step to populate it with the response value you get from the REST call.



Response Signature


@Roger Kallberg  

I have created the response string . Screen shot below. 

Jijesh_0-1685536984564.png

Getting the Response  is  U "{\"result\"[]}". Screen Shot below

Jijesh_1-1685537286235.png

Below variable created for JSON.

Jijesh_2-1685537527000.png

JSON properties screen shot below Do we need to create separate string for Source document. Which one I need to use it

Jijesh_3-1685537638396.png

 

 

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: