1

I am returning a JSON payload from the ServiceNow API via a query using Postman. Currently, the name of the fields in the result are the field names from the ServiceNow table. Is there a way to "rename" the field to something different.

For instance: Original:

{
    "result": [
        {
            "phone": "123-456-7890",
            "user_name": "micmou",
            "name": "Mickey Mouse"
        }
    ]
}

What I want:

{
    "result": [
        {
            "phone_number": "123-456-7890",
            "id": "micmou",
            "full_name": "Mickey Mouse"
        }
    ]
}
Count Boxer
  • 673
  • 3
  • 11
  • 25
  • I would find it bizarre for a REST API to allow overriding fields names via the request itself. Why don't you do this on the client side ? – Arthur Attout Mar 10 '23 at 15:27
  • 1
    I can via the system that will actually call the URL. Since the fields that I want returned are in sysparm_fields, I thought that maybe I could prefix the actual field name with the value I wanted. Something like full_name#name. – Count Boxer Mar 10 '23 at 15:30

0 Answers0