使用Flow将SharePoint列表返回到PowerApps

发布于 2025-02-09 02:48:02 字数 1021 浏览 1 评论 0 原文

我使用此流程将任何SharePoint列表的计数归还到PowerApps。

我将如何修改它以将列表的内容返回到PowerApps,以便我可以使用PowerApps将其放入集合中?

这是否意味着我不必担心委托书是否有2000多个项目?

这就是我到目前为止尝试的。

有一个可变的alteritemscount,我已将其更改为ListItems。而不是使用整数,而是将ListItems设置为数组。

在GET库列表中,我将其用于URI。

concat( '_api/web/lists/GetbyTitle(''', first( body('Filter_Library_List_Being_Queried') )?['displayName'], ''')/Items' )

我不确定要将什么作为最后一步,因为我希望它能够返回任何列表的内容。我认为这排除了解析JSON步骤,因为这需要确定的模式。

我添加了一个申请

运行时我会收到此错误消息。

表达式范围。模板操作的执行 “ apply_to_each”失败:评估“ foreach”的结果 表达式'@body('get_library_list_contents')'是类型的“对象”。 结果必须是有效的数组。

I've used this Flow to return the count of any Sharepoint list to Powerapps.

https://masteroffice365.com/get-sharepoint-library-or-list-total-items-from-power-apps/

How would I modify it to return the contents of a list to Powerapps, so that I can use Powerapps to put it into a collection?

Would this mean I don't have to worry about Delegation if the list has more than 2000 items?

This is what I've tried so far.

There is a variable TotalItemsCount which I have changed to ListItems. Instead of using an Integer I set ListItems to an array.

In the Get Library list contents I use this for the URI.

concat( '_api/web/lists/GetbyTitle(''', first( body('Filter_Library_List_Being_Queried') )?['displayName'], ''')/Items' )

I'm not sure what to put in as the last step given that I want it to be able to return the contents of any list. I think this rules out a parse json step as that requires a definite schema.

I've added an ApplyToEach
enter image description here

I'm getting this error message when it runs.

ExpressionEvaluationFailed. The execution of template action
'Apply_to_each' failed: the result of the evaluation of 'foreach'
expression '@body('Get_Library_List_Contents')' is of type 'Object'.
The result must be a valid array.

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

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

发布评论

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

评论(2

冷心人i 2025-02-16 02:48:02

我认为您无法将阵列返回到PowerApps。您必须将响应作为JSON字符串返回,然后让您的PowerApp执行逻辑以将JSON字符串转换为集合。

您的PowerApp可能必须包含类似的内容才能转换从流量返回的JSON字符串:

ClearCollect(
  *collectionName*,
    MatchAll(
      *JSON_String*,
    *"\{""date"":""(?<date>[^""]*)"",""message"":""(?<message>[^""]*)"",""user"":""(?<user>[^""]*)""\}"*
));

flow flow返回响应主体到PowerApp

I don't think you can return an array back to PowerApps. You would have to return the response as a JSON string, then have your PowerApp do the logic to convert the JSON string into a collection.

Likely your PowerApp would have to include something like this to convert the JSON string that's returned from the flow:

ClearCollect(
  *collectionName*,
    MatchAll(
      *JSON_String*,
    *"\{""date"":""(?<date>[^""]*)"",""message"":""(?<message>[^""]*)"",""user"":""(?<user>[^""]*)""\}"*
));

Flow returning response body to PowerApp

提笔落墨 2025-02-16 02:48:02

如果我正确理解您,您想从SharePoint列表中检索14000个记录,而不仅仅是总数。

这是否意味着我不必担心列表有超过2000个项目吗

? 2K记录。

现在回到您检索记录的主要主题,您必须测试并运行流程,并检查以下HTTP返回的内容。我相信它会返回一个JSON阵列。

concat( '_api/web/lists/GetbyTitle(''', first( body('Filter_Library_List_Being_Queried') )?['displayName'], ''')/Items' )

您必须为每个应用A 或清洁JSON输出以返回字符串数组或JSON数组作为所有14K记录的输出。

此外,如果您在线使用SharePoint,为什么不使用连接器进行flow 在这里

If I understand you correctly, you want to retrieve 14000 records from the Sharepoint list, and not just the total count.

Would this mean I don't have to worry about Delegation if the list has more than 2000 items?

Yes, when you use a cloud flow rather than directly accessing Sharepoint list from Powerapps, you basically avoid delegation of 2k records.

Now coming back to you main topic of retrieving Records, you would have to Test and run your flow and check what does the below http return. I believe it returns a JSON Array.

concat( '_api/web/lists/GetbyTitle(''', first( body('Filter_Library_List_Being_Queried') )?['displayName'], ''')/Items' )

You would have to apply a for each or clean your JSON output to return String Array or JSON Array as output of your all 14K Records.

In addition if you are using Sharepoint online why not use connector for flow mentioned here

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