cancel
Showing results for 
Search instead for 
Did you mean: 

Pagination for Coupa API GET

rpc1235x
New Contributor II

Hello,

I need to extract all records from several Coupa tables using Coupa API. However Coupa only allows to extract 50 records at a time (Coupa documentation). 

I tried implementing the solution in this thread (link) for invoices and suppliers table by 1) keeping the service URL as normal without adding the "?offset=50&exported=false", 2) In Rest GET snap, adding "Has Next" and "Next URL" as stated in the linked thread 

Has Next: eval(sl.ensureArray($.get('entity',[])).length > 0)

Next URL: lib.conf.getAppConf('coupa').basepath.concat("suppliers?offset=",(snap.out.totalCount + 1) * 50, "&exported=false")

Note that for Next URL I modified the "suppliers?" part. For invoices, I changed to "invoices?" (not sure if this is correct).

Either way, this procedure still only gets me 50 records and marks syntax error in "Has Next" and "Next URL" despite turning green

Has Next syntax error: 

rpc1235x_0-1696285756716.png

Next URL: 

rpc1235x_1-1696285796297.png

I would appreciate the help a lot, thank you!!

#coupa #RESTGET #REST #CoupaAPI

0 REPLIES 0