In TMF642 POST, PATCH, and CLEAR responses, we have to assign 32-digit pure integer to id attribute

AnilPathi
Tera Contributor

Hi All,

 

We have a requirement to assign a 32-digit pure integer to the id attribute in TMF642 POST, PATCH, and CLEAR responses. However, when we attempt to assign a pure 32-digit integer, it automatically converts to scientific notation (exponential form).

AnilPathi_0-1745907909891.jpeg

 

Has anyone encountered this issue and successfully resolved it? If you have worked on a similar requirement, please let us know.


Thanks & regards,

Anil Pathi

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@AnilPathi

Sorry didn't get your complete requirement

are you trying to integrate and sending that attribute?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

AnilPathi
Tera Contributor

@Ankur Bawiskar 
Thanks for your quick response.

Yes, we have integrated ServiceNow with an external system using the TMF642 plugin connector. When sending a response back to the external system, we need to populate a pure 32-digit integer in the "id" attribute of the response payload.

However, ServiceNow does not support this and automatically converts the integer into scientific notation (exponential format).

 

@AnilPathi 

since you want 32 digit unique integer, what script are you using?

what is the value you are generating and what is getting converted when you post the API with request?

share some details

I could see in screenshot it's some random sysId and not just simple integer which is of 32 lenght

If my response helped please mark it correct and close the thread so that it benefits future readers

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

AnilPathi
Tera Contributor

@Ankur Bawiskar 

I am using below code to generate 32 digit integer.

 

 generateRandom32DigitNumber: function() {
        var randomNumber = "";
        while (randomNumber.length <32) {
            randomNumber += Math.floor(Math.random() * 10); // Append random digits one by one
        }
        return randomNumber;
    },
Expected value in id attribute:

{
"id":
46719239874963424671923987496342
}
 
The actual value coming in id attribute:
AnilPathi_0-1745914607594.png