Datastream Pagination for XML

MeenaG
Tera Contributor

Hi,

 

I'm new to ServiceNow and have been trying to setup Datastream Integration for a REST API. I can see the details of the records in the first page. However the pagination doesn't seem to work. The offsetToken that is required for pagination is returned in the XML response like below:

<QuarantineQueryResponse resultCount="10" totalCount="25" offsetToken="MQ==">

 

The XPath Expression to get the offsetToken from the above response "/QuarantineQueryResponse/@offsetToken" returns undefined value. So unable to paginate. I do not have access to the response_body in the pageResponse object to implement the pagination using script. 

 

MeenaG_1-1723681161920.png

 

Is there a way to achieve the pagination?

 

Thanks in advance for any insights to the above issue!

 

Best Regards,

Meena

1 REPLY 1

MeenaG
Tera Contributor

For anyone looking to parse the offset token from an XML attribute, I found a solution which seems to work. Since the response body isn't available in the pageResponse object, I'm extracting it using a pagination variable and using it in the script to parse the offsetToken attribute

 

image (2).png