REST Message GET METHOD

AbhishekJain19
Mega Guru

I am integrating my lower instances with PROD to get the Business Application data.

Now, all I need is just two fields data - name & number.

But currently I am getting around 200+ fields data for each record which is not needed.

Secondly,I am getting just 39 records out of 1200 something.

1200 isn't a big number.

 

So I just need assistance in setting up my REST Message GET method.

Any Query parameter or something I can use to get just the required two fields data and can get complete 1200 records.

 

@Ankur Bawiskar

4 REPLIES 4

Mohan raj
Mega Sage
Hi @AbhishekJain19,

Before access endpoint in Rest message try to access same endpoint in Rest API Explorer, here we will add filter, which field data need to access, and limit etc.,

Mohanraj_0-1692278714685.pngMohanraj_1-1692278743771.png
Mohanraj_2-1692278757104.png
 
 
Try to add 
sysparm_fields=number%2Cname to endpoint 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
Regards,
T Mohan

Muhammad 1
Tera Contributor

Hi @AbhishekJain19,
After access endpoint in Rest message try to save response in array and filter which field you want to access through for loop using .

Example:


var data = [ { "optionNumber": 'router', email: 'abc@gmail.com' }, { "optionNumber": 'domain name', email: 'pqr@gmail.com' } ];

 

I declare data variable and save in two record and get only field optionNumber 

var getField = [ ];
and above line i declare getField variable in which i save get field
 (var i = 0; i < data.length; i++) { getField.push(data[i]['optionNumber']) }
console.log(getField );

AbhishekJain19
Mega Guru

Hi @Mohan raj ,

I am still getting 39 records despite not setting any limit

Hi @AbhishekJain19,

Check access to basic AUTH profile user, maybe limited access by ACL or Query BR