电力自动化的先进条件

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

我有一个流程负责使用电子邮件中的文件创建/更新共享点列表。

本质上,流程在电子邮件到达时运行,我检查电子邮件到达的日期和时间,然后根据日期和时间将文件添加到共享点列表中。

我需要共享点列表在某个时间只包含某些文件。例如:

Any email that arrives between Friday 6pm - Monday 9am need to be put in the same list
Any email that arrives between Monday 6pm - Tuesday 9am need to be put in the same list
Any email that arrives between Tuesday 6pm - Wednesday 9am need to be put in the same list
Any email that arrives between Wednesday 6pm - Thursday 9am need to be put in the same list
Any email that arrives between Thursday 6pm - Friday 9am need to be put in the same list

但是,我在构建条件时遇到了问题。以下是我用来获取日期和时间的表达式:

int(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'HH'))

dayOfWeek(triggerOutputs()?['body/receivedDateTime'])

我将如何制定我的条件?

power-automate
1个回答
0
投票

您的五个条件可以归结为两个。

时间戳为上午 9 点之前或下午 6 点之后,或者工作日为周六或周日

or(
   or(
      less(hour(triggerBody()?['myDate']),9),
      greater(hour(triggerBody()?['myDate']),18)
   ),
   or(
      equal(dayOfWeek(triggerBody()?['myDate']),6),
      equal(dayOfWeek(triggerBody()?['myDate']),7)
   )
)
© www.soinside.com 2019 - 2024. All rights reserved.