Need help in formatting the date in service now action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 05:04 AM
Problem Statement: In the output of there are lots of segments of field which contains Date type field which needs to be formatted.
Challenge: I have done the formatting but in the output there are lots of segments of field and that field may be in repeated manner so in each repeat date should be formatted.
Issue: In first Iteration date is formatted correctly but in next logic is not working.
Example for Output:
var Approval_Request = {
"activeApprovalRequestIds": "AAAAADMF1yk6kZX",
"activeApproverCount": 1,
"realm": "hjjhggoinabox",
"records": [
{
"action": "Submitted",
"date": "2023-12-18 08:22:28",
"id": "AAAAADvF1yk6kZU",
"requisitionId": "PR9380",
"summary": "PR9380 submitted for approval.",
"type": "O",
"user": {
"emailAddress": "rgj@bristlecone.com",
"name": "Ritesh Amar Sahu",
"phone": null,
"realm": "emoinabox",
"uniqueName": "ritesh"
}
},
{
"action": "Approved",
"date": "1.702888043181E12",
"id": "AAAAADyF1pGPmF0",
"requisitionId": "PR9380",
"summary": "PR9380 approved.",
"type": "T",
"user": {
"emailAddress": "riteshblkguhe.com",
"name": "Ritesh Amar Sahu",
"phone": null,
"realm": "bconedemoinabox",
"uniqueName": "ritesh.sahu"
}
}
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 05:23 AM
unless you share the script which is generating the above json, we cannot help
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader