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.

Get rows from the transform and print to a JSON string

Evren Yamin
Tera Contributor

Hello,

 

I currently have a transform map that I used to load data in ServiceNow.  I now have a requirement get the rows of the loaded data and convert into a JSON string so I can store that into a field in ServiceNow.

 

This is the sample data:

numbershort descriptionstatecreated
INC1089756sample recordnew4/24/2024

 

I want to convert this to a JSON string that looks like this one:

{number: "INC1089756", short_description: "sample record", state: "state", created: "4/24/2024"}

 

And save the JSON string to a new field. Is this possible? 

 

Appreciate all the help.

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @Evren Yamin ,

A small little change here please make it OnAfter Script instead of onComplete script

SarthakKashya2_2-1713948002526.png

 

Result 

SarthakKashya2_3-1713948038458.png

 

Please mark my answer correct and helpful if this works for you

 

Thanks and Regards 

Sarthak

 

View solution in original post

10 REPLIES 10

Community Alums
Not applicable

Hi @Karunakaran 

Thanks for your input😃

 

Thanks and Regards 

Sarthak