SharePoint是/否字段未从MS Flow更新

问题描述 投票:1回答:1

我有一个简单的流程,可以在收到新电子邮件时创建一个项目:

When a new email arrives > Parse JSON > Create item

然而,该流程确实有效,当输入值为true时,“是/否”字段都不会更新为“是”;默认值为“否”,因此假值将按预期工作。

当收到新电子邮件时

{ ... "Driver": true, ... }

Parse JSON] >>

{
    ...
    "Driver": true,
    ...
}

创建项目

输入

...
Driver
 true
...

输出

...
Driver
 true
...

SharePoint中的列表项

] >>

Driver (Yes/No) is un-checked/false

我已阅读“是/否”列上的“流程失败”的解决方案(大流程),但无济于事。

https://powerusers.microsoft.com/t5/Using-Flows/Flow-fails-on-Yes-No-column-Big-Flow/m-p/35116#M1086

为了确认,我未成功

尝试添加以下动态内容选项:
// In-correctly assumed the below line should work since a Yes/No field is a simple Boolean field;
// returns true but doesn't check the Driver checkbox in Item
body('Parse_JSON')?['json']?['Driver']

// Solution to Flow fails on Yes/No column (Big Flow);
// https://powerusers.microsoft.com/t5/Using-Flows/Flow-fails-on-Yes-No-column-Big-Flow/m-p/35116#M1086
// returns true but doesn't check the Driver checkbox in Item
equals(body('Parse_JSON')?['json']?['Driver'], true)

// All returns true but doesn't check the Driver checkbox in Item
if(body('Parse_JSON')?['json']?['Driver'], true, false)
if(body('Parse_JSON')?['json']?['Driver'], 'True', 'False')
if(equals(body('Parse_JSON')?['json']?['Driver'], true), true, false)
if(equals(body('Parse_JSON')?['json']?['Driver'], true), 'True', 'False')

// Throws error; and Flow fails as expected
if(body('Parse_JSON')?['json']?['Driver'], 'Yes', 'No')
if(equals(body('Parse_JSON')?['json']?['Driver'], true), 'Yes', 'No')

现在,我只是在猜测,所以我想念什么?!

总而言之,我的问题是从MS Flow创建项目时如何成功更新是/否字段?

预先感谢您的任何帮助。 :)

我有一个简单的流程,用于在收到新电子邮件时创建一个项目:当收到一封新电子邮件时>解析JSON>创建项目该流程确实起作用,但是,“是/否”字段都不会更新为“是...”。 >

我偶然发现了一种变通方法和可接受的解决方案,其中使用了向SharePoint发送HTTP请求操作来更新超链接字段的描述(显示文本)和URL字段。

我发现此帖子最有帮助:Updating a Hyperlink field (both url and description) using Flow?

当输入值为true时,我使用相同的方法将所有“是/否”字段更新为“是”。这是其他人可能会有用的关键设置。

Site Address: https://MyFakeSite.sharepoint.com/
Method: POST
Url: _api/web/lists/GetByTitle('MyFakeList')/Items(@{body('Create_item')?['ID']})
Headers: {
  "Accept": "application/json;odata=verbose",
  "Content-Type": "application/json;odata=verbose",
  "X-HTTP-Method": "MERGE",
  "IF-MATCH": "*"
}
Body: {
    '__metadata': {
      'type': 'SP.Data.MyFakeListItem'
    },
    'Driver': @{toLower(string(equals(body('Parse_JSON')?['json']?['Driver'], true)))},
    ...
}
sharepoint sharepoint-online ms-flow
1个回答
0
投票

我偶然发现了一种变通方法和可接受的解决方案,其中使用了向SharePoint发送HTTP请求操作来更新超链接字段的描述(显示文本)和URL字段。

© www.soinside.com 2019 - 2024. All rights reserved.