Search code examples
jsonpowerbim

Passing Query Parameter in a json url not working


I've been trying to pass a parameter in a json url to have the FromDate back to 04 months, for example, but it keeps bringing the whole year.

initialDate="&Date.ToText(DateTime.Date(Date.AddMonths(DateTime.LocalNow(), -MonthParameter)))

It results in the correct date, but I guess there is something wrong with the format it's brought in: 29/07/2019, while the original, static date was yyyy-MM-dd.

Any help will be appreciated.

Cheers, Antonio


Solution

  • You are converting it to a text format.

    You can specify the exact format as below

    Date.ToText(#date(2010, 12, 31), "yyyy/MM/dd")
    

    Details Here