How to use a variable to replace a static value within formatDateTime function?

King Java 500 Reputation points
2024-04-08T18:59:37.2033333+00:00

I am trying to make my ADF expression more dynamically by replacing some static value with a variable within formatDateTime function.

User's image

I am trying to use a variable to change this value 2 as this value can be changed to 2, 1 or 0.

How do I express in the variable?

I tried with something like this, but I am getting an error like below:

User's image

User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,677 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 24,451 Reputation points
    2024-04-09T13:46:59.53+00:00

    As the error mentions that your parameter should be an integer and not Text as you are defining it :

    Based on the documentation :

    Data types can be String, Bool, or Array. Optionally, you can also assign a default value to the variable. This value will be used as the initial value of the variable at the start of a pipeline run

    You need to convert it in the expression using int() function.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.