JSON saved data is showing up empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 10:11 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 11:09 PM
hmm...
Check If data present in source & also as mentioned by @Prince Arora if backend value is correct.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 11:02 PM
Have you used the proper backend field names while fetching the data, please check what are the backend name of fields in source table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 11:13 PM
Please share whether data is present in the source table for those fields
Also ensure source field names are valid
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader