ServiceNow to ServiceNow Rest Integration

manju5
Tera Contributor

Hi,

 

I am creating the ticket in Instance A and ticket is created in Instance B also, but my question is some times description field is appear like "undefined" when we pass the huge description. Could anyone help me why this error coming only when sending the huge description?

 

Thanks,

Manju

16 REPLIES 16

Anand Kumar P
Giga Patron
Giga Patron

Hi @manju5 ,

Payload Size Limitations: Some REST APIs or services impose payload size limitations. If the description is too large, it might exceed these limitations, resulting in unexpected behavior.
Field Size Limitations: Check if there are field size limitations in the receiving system (Instance B) that might be causing the "undefined" behavior when a large description is passed. Some systems have limits on the size of data that can be accepted in a single field.

Thanks,

Anand

I have given the limit is 4000 characters for description field. max_length is 4000 right?

Thanks,

Manju

Hi @manju5 ,
The problem arose because the third-party system rejected multiline text and anticipated the substitution of all "newline" characters with "\n". My solution was to implement the regular expression.

var short_description = "This is a multiline\nstring with newline characters.";
var replacedText = short_description.replace(/\n/g, "\\n");



If it proves effective for you, consider marking it as helpful.

 

Thanks,

Anand

 

It's not working .

Ankur Bawiskar
Tera Patron
Tera Patron

@manju5 

You said sometimes it shows undefined. It means the script is restricting large data in that field.

Can you share what and how the setup is done via screenshots?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader