Reputation: 191
I am using the below expression in the copy data activity to append current month and year to the filename. I want to pass next month date to the filename(testingfile1220222)
ex:testingfile112022(current month 11 and year 2022)
expected: testingfile122022(next month 12 and year 2022)
@concat(pipeline().parameters.pipelinepath,'testingfile',formatDateTime(utcNow(),'MM'),formatDateTime(utcNow(),'yyyy'),'.csv'')/$value/')
Upvotes: 0
Views: 1161
Reputation: 6104
I have used the following dynamic content to build a name for my sample file. It has given the expected output of testingfile122022.csv
.
12
, adding one would result in month number as 13. So, to avoid this, I have taken the if condition to avoid this.@concat('testingfile',if(equals(12,int(formatDateTime(utcNow(),'MM'))),'01',string(add(int(formatDateTime(utcNow(),'MM')),1))),formatDateTime(utcNow(),'yyyy'),'.csv')
getFutureTime
as suggested by @Scott Mildenberger using the following dynamic content.@concat('testingfile',formatDateTime(getFutureTime(1,'Month'),'MM'),formatDateTime(utcNow(),'yyyy'),'.csv')
NOTE: I have run this on 1/11/2022.
Upvotes: 1