Hi @Jay ,
Thanks for reaching and posting your query.
You dynamic expressions looks good and it should return the start of day (for eg: "2018-03-15T00:00:00.0000000Z"
) since your are using startOfDay function
I did tested your expression as-is and the result is as expected. Please see below GIF
Here is the sample pipeline json payload, in case if you would want to retest or play around it.
{
"name": "pipeline5",
"properties": {
"activities": [
{
"name": "Set variable Hardcoded value",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "varTime",
"value": {
"value": "@adddays(startOfDay(utcnow()),-1)",
"type": "Expression"
}
}
},
{
"name": "Set variable Parameter",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "varTime2",
"value": {
"value": "@adddays(startOfDay(utcnow()),pipeline().parameters.paramDays)",
"type": "Expression"
}
}
}
],
"parameters": {
"paramDays": {
"type": "int",
"defaultValue": -1
}
},
"variables": {
"varTime": {
"type": "String"
},
"varTime2": {
"type": "String"
}
},
"annotations": []
}
}
Hope this helps. In case if you see a different behavior, could you please share your pipeline JSON payload and the screenshot of output you are receiving?
----------
Please don’t forget to Accept Answer
and Up-Vote
wherever the information provided helps you, this can be beneficial to other community members.