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
Tera Patron

Hi,

specify your fields separated by comma

sysparm_field =  number,short_description,caller_id.name

Regards
Ankur

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

View solution in original post

14 REPLIES 14

Hi Ankur,

Could you please share some sample ? I am getting error.

find_real_file.png

 

 

Regards,

Sagaya .

 

@Sagaya 

Can you explain what is your exact requirement?

Are you saying you want to get the fields via sysparm_fields for scripted REST API?

I doubt this can be achieved for scripted rest API.

those parameters are available for OOB Table API

Regards
Ankur

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

Hi Ankur,

Yes , you want to get the fields via sysparm_fields for scripted REST API.

My requirement need to retrieve  few column from the table instead of all column of the record.

For sample : Table 'test' has 20 columns , i need 4 column data only.

In Gliderecord API , i am unable to retrieve the specific column records[s] and it will retrieve all columns. 

In API explorer we have  sysparm_fields and  getting required column based sysparm_fields.

So could you help me achieve this through scripted REST API.

 

Regards,

Sagaya.

Hi Ankur,

Yes , I want to get the fields via sysparm_fields for scripted REST API.

My requirement need to retrieve  few column from the table instead of all column of the record.

For sample : Table 'test' has 20 columns , i need 4 column data only.

In Gliderecord API , i am unable to retrieve the specific column records[s] and it will retrieve all columns. 

In API explorer we have  sysparm_fields and  getting required column based sysparm_fields.

So could you help me achieve this through scripted REST API.

 

Regards,

Sagaya.

Hi,

as I mentioned it might not be possible for Scripted REST API but available only for OOB Table API

Why not send the list of fields for which data is required in the POST body

{

"field":"number,caller_id"

}

Then parse the request body and get data for all those fields

Regards
Ankur

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