动态地将天数传递给 Azure 管道中的 adddays 函数
Pass number of days to adddays fucntion in azure pipeline dynamically
正在尝试传递天数以在 Azure 管道中动态地从日期中减去,如下所示:
@{concat(adddays(formatdatetime(pipeline().parameters.StartDate,'MM/dd/yyyy'),-item().Prop_3),' ',item().Prop_2)}
The Variable item().Prop_3 has value like 1, 2 The value is reading from ForLoop.
上面的表达式表示无法识别的表达式:-item().Prop_3
错误是由'-item().Prop_3'引起的,动态内容不支持这个负数表达式。 @Joel Cochran 是正确的,您可以使用 mul(item().Prop_3, -1)
将其转换为负数:
请尝试:
@{concat(adddays(formatdatetime(pipeline().parameters.StartDate,'MM/dd/yyyy'),mul(item().Prop_3, -1),' ',item().Prop_2)}
我做了一个例子你可以参考:
错误已解决。
正在尝试传递天数以在 Azure 管道中动态地从日期中减去,如下所示:
@{concat(adddays(formatdatetime(pipeline().parameters.StartDate,'MM/dd/yyyy'),-item().Prop_3),' ',item().Prop_2)}
The Variable item().Prop_3 has value like 1, 2 The value is reading from ForLoop.
上面的表达式表示无法识别的表达式:-item().Prop_3
错误是由'-item().Prop_3'引起的,动态内容不支持这个负数表达式。 @Joel Cochran 是正确的,您可以使用 mul(item().Prop_3, -1)
将其转换为负数:
请尝试:
@{concat(adddays(formatdatetime(pipeline().parameters.StartDate,'MM/dd/yyyy'),mul(item().Prop_3, -1),' ',item().Prop_2)}
我做了一个例子你可以参考:
错误已解决。