azure - 比较 Azure 数据工厂表达式中的日期
问题描述
当我今天在我的 IF 条件活动中运行此表达式时,此表达式的评估结果为 false
@equals(
activity('Pick the 4th working day').output.firstRow,
formatDateTime(utcnow(),'MM-dd-yyyy'))
但是,我得到了 Pick the 4th working day as
Output
{
"firstRow": {
"4thWorkingDay": "03-04-2021"
任何想法?
解决方案
在您的情况下,此表达式的输出activity('Pick the 4th working day').output.firstRow
是 Object 类型,但formatDateTime(utcnow(),'MM-dd-yyyy')
' 的结果是 String 类型。这就是他们不平等的原因。
{
"4thWorkingDay": "03-04-2021"
........
}
解决方案:使用以下表达式:
@equals(
activity('Pick the 4th working day').output.firstRow['4thWorkingDay'],
formatDateTime(utcnow(),'MM-dd-yyyy'))
我的测试:
推荐阅读
- javascript - 区分数组中的修改对象或聚合
- scala - 如何使用 IO Monad 退出 For-Comprehension
- javascript - 假设我有两个包含相关数据的数组。如何搜索第一个数组并返回数组 1 和数组 2 之间合并的相关数据?
- vue.js - Vue-Native 复选框更改值
- javascript - 鼠标按下时如何重复调用函数?
- express - 在 Socket.io 授权期间获取 SessionID?
- sql - 如何将具有多个值的分类变量转换为sql中的多个二进制变量?
- python - 如何在 Django 中使用 ArrayField 存储 Python 字符串列表
- lets-encrypt - 为golang服务器创建letsncrypt + certbot-auto证书的命令是什么
- java - 如何根据状态打印出列表项?