Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Convert regular JSON to TMF formatted JSON

snowdev8
Tera Expert

Hello,

We will be receiving a nonTMF/custom JSON payload from external system(s) that we need to convert to TMF format(in our case TMF622 format) . What's the best way to attain this ? Creating a scripted REST API or Transform Map seems to be the only way I can think of. Has anyone worked on a similar requirement? Any guidance is appreciated

3 REPLIES 3

Shubham44
ServiceNow Employee
ServiceNow Employee

Hi,

Under TMFOrderAPIConstants you will see the JSON schema validation, just change the validation schema and you should be good i believe.

Where do I find TMFORDERAPICONSTANTS?

Shubham44
ServiceNow Employee
ServiceNow Employee

hi

When you actually see the scripted API, there is a line in TMFProductOrderAPIUtil

 

       var schema = this.productOrderProcessor.getProductOrderSchema();

 

this basically picks the schema from 

getProductOrderSchema: function() {
return JSON.parse(TMFOrderAPIConstants.SCHEMA.CREATE_PRODUCT_ORDER);

 

here in you can open TMFOrderAPIConstants to get the product order schema and you can change that if needed from script overrides extensions.