parameter default value

arkiboys 9,706 Reputation points
2021-09-13T15:58:47.557+00:00

Hello,
One of the pipeline parameter is pDate which I pass in manually each time I want o run the pipeline.
Is there a way to set the default of this parameter of the pipeline to be today's date?
When I hover over the textbox, I do not get a link for dynamic content.
Thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,639 questions
0 comments No comments
{count} vote

Accepted answer
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2021-09-14T04:52:29.15+00:00

    Hi @arkiboys ,

    Thank you for posting query on Microsoft Q&A Platform.

    Parameters will not accept expressions as default value. So with parameter you cannot achieve getting current datetime as default value using utcnow() function.

    You can consider having a variable for this requirement. For variable you can pass @{utcnow()} as default value that will set current date time vaule in that variable.

    In below example, I created two variables "currentDateTimeVar" & "var2". I am setting default value for "currentDateTimeVar" as @{utcnow()}.
    Now, using set variable activity I am trying to pass value of "currentDateTimeVar" in to "var2". This will help me to know @{utcnow()} function actually storing value in to "currentDateTimeVar" variable or not.

    131699-variabledefault.gif

    Hope this will help. Please let us know if any further queries.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Nandan Hegde 36,151 Reputation points MVP Volunteer Moderator
    2021-09-13T16:01:33.497+00:00

    Hey,
    Unfortunately based on my understanding that is not possible.
    So rather than referring your original parameter in your downstream queries, you can leverage a variable.

    And that variable value would be parameter value which is passed out and it can be utcnow() in case if it is null.
    And you can check whether a parameter is null by using equals and coalesce functions.


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.