sysparm_fields in scripted REST API

Sagaya1
Giga Expert

Hi ,

I need to retrieve specific column from table instead of whole row from Gliderecord .  Have noticed it can be achievable through "sysparm_fields"  in table API . How can I do in Gliderecord . Please help.

 

find_real_file.png

 

Regards

Sagaya

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

Hi,

specify your fields separated by comma

sysparm_field =  number,short_description,caller_id.name

Regards
Ankur

View solution in original post

14 REPLIES 14

Hi Ankur,

As per the user requirement , cannt include additional  attribute in post .

 

Regards,

Sagaya . 

Hi,

then not possible

Since the only possible way to send data from 3rd party to ServiceNow via POST is the request body

Regards
Ankur

Hi Ankur,

Thank you for your help and support.

 

Regards,

Sagaya.

Geetika4
Mega Expert

Hi Sagaya,

I also want to achieve the same via scripted rest api, Let me know how you achieved it.

Geetika4
Mega Expert

Hi @Sagaya ,

If you are still looking for the solution through scripted API , I can suggest how I achieved it.

You can use below code 

var req = new sn_ws.RESTMessageV2();
req.setEndpoint(restUrl);
...
...
...
req.setQueryParameter("sysparm_fields","name,u_tribe");

Here you third party will get only "name" and "u_tribe" column.
Tried and tested from my end.

Regards,

Geetika