简体   繁体   English

从 Power 自动到共享点列表的日期字段

[英]Date field from Power automate to sharepoint list

I have set automate up to parse an email i recieve regularly.我已经设置了自动解析我定期收到的电子邮件。 The email is system generated through third party software without an API to link directly to SharePoint.电子邮件是通过第三方软件系统生成的,没有直接链接到 SharePoint 的 API。

I have used the initialise variable function to parse the HTML from the email and create a new list item.我使用了初始化变量函数来解析电子邮件中的 HTML 并创建一个新的列表项。

All fields work, however the Date will not pull through and fails the flow entirely.所有字段都有效,但是 Date 不会通过并完全使流程失败。

I get this error:我收到此错误:

The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. “OpenApiConnection”类型的工作流操作“Create_item”的“inputs.parameters”无效。 Error details: Input parameter 'item/DateTime' is required to be of type 'String/date'.错误详情:输入参数“item/DateTime”必须是“String/date”类型。 The runtime value '"25/02/2022"' to be converted doesn't have the expected format 'String/date'.要转换的运行时值“25/02/2022”不具有预期的格式“字符串/日期”。

My column settings in the List are Date & Time field with Date Only set.我在列表中的列设置是日期和时间字段,其中仅设置了日期。

列表列设置 日期 变量

I hope I've understood your problem correctly but the format 25/02/2022 is not considered to be a valid ISO 8601 date.我希望我已正确理解您的问题,但格式25/02/2022不被视为有效的 ISO 8601 日期。

I created a variable called Date Time String and stored your date of 25/02/2022 .我创建了一个名为Date Time String的变量并存储了您的日期25/02/2022

To make it valid, you need to convert it and to do that, this expression should do the trick.为了使其有效,您需要对其进行转换并为此进行转换,这个表达式应该可以解决问题。

concat(split(variables('Date Time String'), '/')[2], '-', split(variables('Date Time String'), '/')[1], '-', split(variables('Date Time String'), '/')[0])

It essentially reverses the date into a format that SharePoint will accept.它实质上将日期反转为 SharePoint 将接受的格式。

Before

日期时间字符串

After

强类型日期时间

New List Item Result新列表项结果

项目清单

You can also parse the date time and then use formatDateTime to output the format you want, see below:您也可以解析日期时间,然后使用formatDateTime输出您想要的格式,见下文:

formatDateTime(parseDateTime(variables('Date Time String'), '', 'dd/MM/yyyy'))

Note: In the example above I did not specify a format for formatDateTime (only the parsing step), this will default to outputting the datetime in ISO format which is compatible with SharePoint.注意:在上面的示例中,我没有为 formatDateTime 指定格式(仅解析步骤),这将默认以与 SharePoint 兼容的 ISO 格式输出日期时间。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法从 Power Automate 中的 JSON 响应中的动态列表列表中提取值 - Unable to extract values from a dynamic list of lists in a JSON response in Power Automate SharePoint Rest API使列表中的日期字段少于一小时 - SharePoint rest API bringing back one hour less than date field in list SharePoint Online将项目发布到带有元素字段的列表中 - SharePoint Online posting an item to a list with element field 在 Power Automate 中将 HTML 转换为 PDF - Convert HTML to PDF in Power Automate 如何从“收到 HTTP 请求时”获取文件附件在 Power Automate 中触发操作 - How to get file attachment from “When a HTTP request is received” Trigger Action in Power Automate 在 Power Automate 中,如何从 a.csv email 附件中获取数据并将其格式化以进行显示? - In Power Automate, how to get data from a .csv email attachment and format it for display? 在 MS Power Automate 中,如何使用另一个操作的结果填充动态属性下拉值? - In MS Power Automate, how to populate dynamic property dropdown value using the result from another action? 如何使用 Rest API 将地理位置值发布到 Sharepoint 列表字段? - How to POST Geolocation values to a Sharepoint List Field with Rest API? Microsoft Graph 更新 SharePoint 列表项多选字段 - Microsoft Graph update SharePoint list item multi choice field SharePoint 查找字段格式链接到列表项其引用 - SharePoint lookup field format link to list item its referencing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM