question

GahyunLim-3459 avatar image
0 Votes"
GahyunLim-3459 asked Ehren answered

How to set default values for parameters

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

power-query-not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Ehren avatar image
0 Votes"
Ehren answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.