azure - 逻辑应用程序 - HTTP POST/Upsert 少量数据

标签 azure azure-logic-apps

我正在尝试从 Service Now 获取大量数据 → 在逻辑应用程序中更改其中的一些 JSON 正文 → 并将其更新到 SAP。

这是我在逻辑应用程序中应用的逻辑:

enter image description here

从 Service Now 获取数据的 HTTP:

enter image description here

解析 JSON 并初始化数组变量以存储最终输出:

enter image description here

For Each 循环更改每条记录的 JSON 正文,然后将每条记录附加到数组变量:

enter image description here

enter image description here

HTTP POST top 将变量中的所有(6213 条记录)数据更新到 SAP:

enter image description here

这是我运行逻辑应用程序时来自 SAP 的限制消息:

<?xml version="1.0" encoding="utf-8"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code>BadRequestException</code><message lang="en-US">Upsert content exceeds the limitation, the maximum size is 1000</message></error>

...SAP https://apps.support.sap.com/sap/support/knowledge/en/2615424 的预期

有人可以告诉我如何从 Logic App 更新插入少量数据吗?

最佳答案

我对SAP upsert不太清楚,但是如果您的要求是将allProjects单独到多个集合(少于1000条记录),然后对每个集合进行upsert,您可以引用我的逻辑下面的应用程序:

1. 我使用以下操作创建了一个逻辑应用来模拟您的 allProjects(您无需关心此步骤的详细信息) enter image description here

2. 然后我初始化四个变量。 enter image description here

3.使用“If”条件判断allProjects的大小。 enter image description here

4. 如果为 false,则可以直接使用 allProjects 进行 upsert 操作。如果属实: enter image description here 设置size值的整个表达式为add(div(length(variables('allProjects')), 1000), 1)

5.使用Until循环,退出循环的条件是size等于0 enter image description here

6.

“Until”中前两个操作的详细信息如下所示(在“HTTP”操作中执行 upsert 操作): enter image description here

上面的表达式应该是 take(variables('restProjects'), 1000) 而不是 take(variables('restProjects'), 3)。取前3条记录用于测试。

“Until”中接下来三个操作的详细信息如下: enter image description here

关于azure - 逻辑应用程序 - HTTP POST/Upsert 少量数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65300235/

相关文章:

Azure 应用服务插槽配置和交换期间重新启动

azure - 使用Azure逻辑应用程序发送带有多个附件的电子邮件

azure - 为什么不使用逻辑应用自动生成 Azure Blob MD5 校验和?

azure - 覆盖 Azure 网站上的缓存控制 header

azure - 从 Blazor 客户端中长时间运行的后台任务中释放 UI 的推荐方法是什么

Azure 集成帐户 - 如何管理嵌套/组合架构

azure - 使用 ARM 模板通过服务主体身份验证为 Azure 数据工厂创建 API 连接

azure - LogicApp 自定义连接器动态架构响应字段

git - 向 Microsoft 请求凭据后 URL 身份验证失败

azure - 如何增加 Azure AD B2C 上守护程序应用程序的 token 生命周期