Blue Clouds
Blue Clouds

Reputation: 8153

ADF expression adddays() giving error "The datetime string must match ISO 8601 format"

for ADF parameter I provided @{formatDateTime(adddays(utcnow(),-5),'yyyy-MM-01')) in Debug/trigger but I get this error.

In function 'formatDateTime', the value provided for date time string '@{formatDateTime(adddays(utcnow(),-5),'yyyy-MM-01')) ' was not valid. The datetime string must match ISO 8601 format

I have also tried these and it does not work.

@adddays(utcnow('yyyy-MM-dd'),1)
@{formatDateTime(adddays('2021-02-09T08:40:00.4158787Z',-5),'yyyy-MM-01'))
@{formatDateTime(adddays('2021-02-09T08:40:00.4158787Z',-5),'yyyy-MM-ddTHH:mm:ss:fffffffK'))

Upvotes: 3

Views: 9190

Answers (2)

Blue Clouds
Blue Clouds

Reputation: 8153

Manual Debug or trigger will not expand with "@" . Give the end result directly eg: "2021-02-09T08:40:00.4158787Z". To test expressions use this method.

Upvotes: 1

wBob
wBob

Reputation: 14379

Your first expression should be: @formatDateTime(addDays(utcnow(),-5),'yyyy-MM-01'). Remove the starting curly bracket and one additional trailing bracket.

It's the same for the others. ADF expression always start with @ symbols, curly brackets are used in string interpolation and of course must match up.

Upvotes: 4

Related Questions