Logic Apps中的图形分页 [英] Graph Pagination in Logic Apps

查看:85
本文介绍了Logic Apps中的图形分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过HTTP连接器,注册的应用程序和Microsoft Graph从特定组中获取所有用户.

注册的应用程序具有Directory.Read.All权限.

我的想法是,只要将所有获取的用户的userPrincipalName附加到数组中,并最终将组中的所有用户填充到该数组中,我就一直在调用nextLink.

我的逻辑应用程序看起来像这样:

很遗憾,我的发布图片还不到1个声誉,请原谅.这3个链接应该概述我的应用程序的结构.

首先,将nextLink初始化为第一个Graph API端点.在直至循环的每次迭代中,此变量都设置为当前nextLink.

第二,出于本练习的目的,我仅获得前5名.我知道只有9个用户:

最后,我在前面初始化的用户"数组和HTTP get方法的值"数组上调用union方法,以获得一个由所有用户组成的单个数组:


问题在于HTTP操作始终返回相同的前5位用户.通过从运行历史记录中将其复制并粘贴到Microsoft Graph Explorer中,我已经检查了在对Graph的第一个HTTP GET调用中提供的nextLink是否正确,

我还要确保,对于〜循环中的每个迭代,都按预期使用上一次迭代中的nextLink调用Graph API.

当我在Graph Explorer中对其进行测试时,在Logic App内部返回的nextLink完全相同,但是当从Graph Explorer和在Logic App内部进行调用时,相同的nextLink返回2个不同的结果.

为什么结果总是总是与前5个用户相同,而不是预期的前4个用户?

解决方案

此问题由OP自身解决,此问题是由于请求URL中的查询,请复制OP的注释作为答案:

在对每个人提供的内容进行了更多的摆弄之后 找到了解决方案.似乎当查询参数传递给 端点本身之外的HTTP GET(意思是查询" 块中的字段),似乎一直覆盖nextLink. 当完全使用odata参数写出端点URL时, 它按预期工作.

I'm trying to fetch all users from a specific group via an HTTP connector, a registered app, and Microsoft Graph.

The registered app has Directory.Read.All permissions.

My idea is that I'm calling the nextLink as long as it's there while appending all of the fetched users' userPrincipalName to an array eventually filling the array with all users of the group.

My Logic App looks like this:

Unfortunately, I'm just 1 reputation short of posting images, please forgive. The 3 links should provide an overview of the structure of my app.

First, nextLink is initialized to the first Graph API endpoint. This variable is set to the current nextLink through each iteration of the until loop.

Second, For the purpose of this exercise, I only get the top 5. I know there are only 9 users:

Lastly, I call the union method on the "users" array that I initialized earlier and the "value" array from the HTTP get method, to get one single array consisting of all users:


The issue is that the HTTP action always returns the same top 5 users. I've checked that the nextLink provided in the first HTTP GET call to Graph, is correct by copying it from the Runs history and pasting it into Microsoft Graph Explorer and there the next 4 users are correctly returned.

I also made sure that, for each iteration in the until loop, I call the Graph API with the nextLink from the previous iteration as expected.

The nextLink returned inside of the Logic App is exactly the same when I test it in Graph Explorer, but the same nextLink returns 2 different results when called from Graph Explorer and inside my Logic App.

Why is the result always the same top 5 users and not the next 4 users as expected?

解决方案

This issue solved by OP self, this issue is due to queries in request URL , copy OP's comment as an answer :

After fiddling a bit more around with what each of you providing I found a solution. It seems that when the query arguments are passed to the HTTP GET outside of the endpoint itself (meaning in the "queries" field inside of the block) it seems to keep overriding the nextLink. When writing the endpoint URL out entirely with the odata parameters, it works as intended.

这篇关于Logic Apps中的图形分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆