Power BI仅在使用哈希键时返回第一个分页

发布于 2025-01-28 01:40:12 字数 1084 浏览 3 评论 0原文

我正在尝试从使用哈希键获取下一页的API中获取数据,该密钥来自第一个请求,为了获得下一页,我需要附加键并将其添加到这样的URL:

baseurl& “& next =”&键。

第一页和第二页加载良好,但是当它到达第三页时,它会不断地给我第二页键不会根据您在中的页面进行更改。

我已经在Postman中运行它,并且通过手动复制和粘贴哈希键来获得不同的页面。

这是我的代码:

        let

        iterations = 6,          // iterations just for testing

        BaseUrl = Text.Combine({"URL"}),
        Headers0 = [Headers=[header1="header"]],
    
    
        
        GeneratedList =
        List.Generate( ()=>
        [ i= 0, URL = BaseUrl,
        Result = Json.Document(Web.Contents(URL, Headers0))],
    
    
        each [i]<iterations,
    
        each [ i=[i]+1,
(where "next" is the field of the 1st request that contain the "key" for the next page)
                URL = "URL"&[Result][next],
                Result = Function.InvokeAfter(()=> Json.Document(Web.Contents(URL,Headers0)), #duration(0,0,0,5))
        ]),

这就是我的结果的样子

I'm trying to get data from an API that uses a hash key to get the next page, the key comes from the first request and in order to get the next page I need to append the key and add to the URL like this:

BASEURL & "&next=" & KEY.

The first page and 2nd page loads fine but when it reaches the 3rd page it keeps giving me the 2nd page the key does not change based on the page you are in.

I have run it in postman and I do get the different pages by manually copying and pasting the hash key.

Here is my code:

        let

        iterations = 6,          // iterations just for testing

        BaseUrl = Text.Combine({"URL"}),
        Headers0 = [Headers=[header1="header"]],
    
    
        
        GeneratedList =
        List.Generate( ()=>
        [ i= 0, URL = BaseUrl,
        Result = Json.Document(Web.Contents(URL, Headers0))],
    
    
        each [i]<iterations,
    
        each [ i=[i]+1,
(where "next" is the field of the 1st request that contain the "key" for the next page)
                URL = "URL"&[Result][next],
                Result = Function.InvokeAfter(()=> Json.Document(Web.Contents(URL,Headers0)), #duration(0,0,0,5))
        ]),

This is how my result looks like

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自唱情﹋歌 2025-02-04 01:40:12

如果任何人都有相同的问题,如果您调用相同的URL,您要去上面会收到一个缓存的响应,我的解决方案是通过与上一个通话不同的标题中的随机值传递

In case anyone has the same problem, if you call the same URL you are going top receive a cached response, my solution was passing a random value in the headers different from the previous call

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文