Datastream Pagination for XML
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 05:25 PM
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.
Is there a way to achieve the pagination?
Thanks in advance for any insights to the above issue!
Best Regards,
Meena
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2024 05:07 PM
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