Getting a new mandatory field when using GET method in Rest Explorer

shalinising
Kilo Contributor

I am getting this mandatory field

*sys_id when trying to use REST Explorer GET Method.

What am I suppose to fill here. If I give one record sys_id it will so only that one record in my result. I want all the data for which query has been created. This is somehting new. Earlier there was no such mandatory field requirement.

Please help.Untitled.png

4 REPLIES 4

Najmuddin Mohd
Mega Sage

Hello @shalinising ,

 

The Table API is configured to get one record every time. If you want multiple records with a particular query, you can write a for loop and pass the sys_Id to the end point.


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Viraj Hudlikar
Tera Sage

Hello @shalinising 

Why not use other method which is available "Retrieve records from a table"

VirajHudlikar_1-1739104540265.png

sysparam_query = active=true^numberININC0010038,INC0010034,INC0010023

VirajHudlikar_2-1739104593280.png

 

Response for get call:

 

{
  "result": [
    {
      "number": "INC0010023",
      "short_description": "Test Major 2 from native.",
      "caller_id": "User 1",
      "active": "true",
      "state": "New",
      "priority": "5 - Planning"
    },
    {
      "number": "INC0010034",
      "short_description": "test attachement",
      "caller_id": "User 1",
      "active": "true",
      "state": "New",
      "priority": "5 - Planning"
    },
    {
      "number": "INC0010038",
      "short_description": "Test of reopned field.",
      "caller_id": "Abraham Lincoln",
      "active": "true",
      "state": "In Progress",
      "priority": "5 - Planning"
    }
  ]
}

 

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @shalinising 

The Get Record method will only retrieve one record every time 

As viraj mentioned, use Retrieve Records Get method.

 

 

Please mark the answer as helpful and correct if helped.

Kind Regards,

Ravi Chandra  

Ankur Bawiskar
Tera Patron
Tera Patron

@shalinising 

You are using wrong API.

The correct one is Retrieve records from a table which accepts encoded query

AnkurBawiskar_0-1739105825836.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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