0
votes

I want to pass a value for parameter usertime, the value should be like 2020-07-23T13:19:31Z , which will be used in my source connection url.

For this i supplied utcnow() function in the value tab. But i realized utcnow() will return the value as "2018-04-15T13:00:00.0000000Z"

To remove the millisecond part i have used the expression substring(utcnow(),1,20). and also used expression formatDateTime('utcnow()', 'yyyy-MM-ddTHH:mm:ss').

Both my trails are useless where my expression returning error ass invalid parameter.

Could you please help me how can i supply the value 2020-07-23T13:19:31Z in Azure data factory datasource parameters.

1

1 Answers

0
votes

You don't want utcNow inside quotes, here is an example from one of my pipelines using your format:

@formatDateTime(utcnow(), 'yyyy-MM-ddTHH:mm:ss')

which gives this result, setting a variable named x:

{
    "name": "x",
    "value": "2020-07-24T13:44:42Z"
}

Build it in 'Add dynamic content' as you can pick the functions and it will format properly if you aren't familiar.

Your substring won't work because it requires a string for the first parameter and utcnow is a timestamp.