Share via

How to set default values for parameters

Gahyun Lim 1 Reputation point
2021-03-12T05:33:11.677+00:00

I want to set the default value of the parameter according to the current time.

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Ehren (MSFT) 1,786 Reputation points Microsoft Employee
    2021-03-17T21:25:58.877+00:00

    There's currently no way I know of to make a parameter default to the current date and time, but you can get the current date to show up in the dropdown list of values. Just set your parameter's Suggested Values dropdown to Query, and point it at a query that returns a list containing the current date and time, a la:
    = {DateTime.FixedLocalNow()}

    Another option would be to modify your logic so that if the parameter is blank, the current date/time is used. Then users can leave it blank and get the default behavior.

    Was this answer helpful?

    0 comments No comments

Your answer

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