How to obtain a response header value in a data stream action?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 08:29 AM - edited 06-24-2023 08:45 AM
Hi community,
I'm configuring a data stream action in Flow Designer. I'm stuck in the "pagination step".
How can I obtain a response header value?
The scenario is:
In the REST step, the answer from the external system has a "token" to know if is there more data to retrieve. The response header is called "x-foundation-continuation" (see an extract of the JSON answer)
The FD step execution runtime is showing it:
I need to use this value to change to true/false the getNextPage (read-only) variable in the pagination step, but I can't get it.
In this step (pagination) the two available variables are: variables and pageResponse. I'm trying using pageResponse but it seems empty.
The option to obtain it from the Response Body doesn't cover the need here, because the value is coming in the Response Header.
I tried to do it like this; it doesn't works too.
Any help is welcome.
Thanks,
Ariel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 09:01 AM
Following this article: https://hishowcase.service-now.com/kb?id=kb_article_view&sysparm_article=KB0756552
I found a potential solution/example of how to access the response_headers variable.
I'm testing it. First test, wrong 😞

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 02:29 AM - edited 06-26-2023 03:04 AM
I'm sorry to bother you here. I saw your videos:
- IntegrationHub Data Stream for Import Data Source - Live Coding Happy Hour for 2021-01-15 (17:38 pagination)
- Data Stream Actions - Learn Integrations on the Now Platform
One of them is the example:
totalCount = parseInt(pageResponse.responde_headers(['X-Total-Count']);
I have the same situation. In my case, the "token" to decide to get more data is in the response headers, but when I execute the action, it seems response_headers variable is empty.
Any idea?
Thanks,
Ariel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 03:30 PM
Hi @arielgritti
The correct script is:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2023 06:16 AM - edited 07-06-2023 06:17 AM
Hi @User279787
I can see a typo in my code (I'll review it) "responde" instead of "response" (I don't know if it was a copy&paste issue when I created my community question) and the brackets and parenthesis use.
I'll check and let you know.
Thanks for your answer.
Ariel