将Outlook电子邮件中的日期和时间格式化为Excel工作表,使用Power Automate。

huangapple go评论80阅读模式
英文:

Format Date and Time from an outlook email into excel sheet using power automate

问题

我正在尝试将日期和时间格式化为类似于 01/01/2023 08:00 上午的格式,在Power Automate中。我使用了表达式 formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'MM/dd/yyyy hh:mm tt')。我的问题是,我的Outlook显示我收到的电子邮件是在'2/7/2023 5:00 下午'(这也是我想在Excel中显示的格式),但在Excel中显示为'2/8/2023 0:00'。如何在Power Automate中将格式转换为我所需的格式?

英文:

I am trying to format the date and time to look like 01/01/2023 08:00 am in power automate. I used the expression formatDateTime(triggerOutputs()?['body/receivedDateTime', 'MM/dd/yyyy hh:mm tt). The issue I'm having is that my outlook shows that the email I received is on '2/7/2023 5:00 pm' (this is also the format I want shown in excel) but on excel it shows '2/8/2023 0:00'. How can I convert the format to my desired format in power automate?

答案1

得分: 0

在你分享的代码片段中,有几处拼写错误。一个右方括号缺失,日期时间格式的单引号字符也缺失。

你可以尝试使用以下表达式代替:

formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'MM/dd/yyyy hh:mm tt')

此外,检查一下流程运行中的输入和输出,确保它被 Power Automate 正确格式化。

此外,请再次检查 Excel 列的格式设置。数值可能是正确的,但格式可能不同。

在单元格 B2 中,你可以看到数值显示为 "AM",但列 B 的格式可能不同。

英文:

In the code snippet you shared there are a couple of typos. A closing square bracket is missing and a closing single quote character for the date time format is missing.

Can you try the expression below instead?

formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'MM/dd/yyyy hh:mm tt')

将Outlook电子邮件中的日期和时间格式化为Excel工作表,使用Power Automate。

Also check your inputs and outputs in the flow run to make sure it is formatted correctly by Power Automate.

将Outlook电子邮件中的日期和时间格式化为Excel工作表,使用Power Automate。

Also double check the column formatting setting within Excel column. The value might be correct, but the formatting could be different.

Below in Cell B2 you can see the value shows AM, but the format of B is different.

将Outlook电子邮件中的日期和时间格式化为Excel工作表,使用Power Automate。

huangapple
  • 本文由 发表于 2023年2月9日 03:21:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75390754.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定