JSON saved data is showing up empty

ServNowDev
Tera Guru

I have a transform script that takes the source data and puts into a json and then put that json info into a Script Field on the target table. Here is the code below but the field on the target table keeps displaying the data with empty values. 

 

(function runTransformScript(source, map, log, target) {

    // Add your code here
    var jsonData = {
        destination: source.u_destination_country,
        departure_date: source.u_departure_date,
        return_date: source.u_return_date,
    };


    var jsonString = JSON.stringify(jsonData);

    target.actual_data = jsonString;


})(source, map, log, target);

 

I have a client script as well but its not showing any help to display the data, here is what the field looks like below empty

 

Screenshot 2023-10-05 at 1.10.25 AM.png

 

7 REPLIES 7

hmm...

Check If data present in source & also as mentioned by @Prince Arora if backend value is correct.

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Prince Arora
Tera Sage
Tera Sage

@ServNowDev 

 

Have you used the proper backend field names while fetching the data, please check what are the backend name of fields in source table.

Ankur Bawiskar
Tera Patron
Tera Patron

@ServNowDev 

Please share whether data is present in the source table for those fields

Also ensure source field names are valid

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