Forum Discussion
Anonymous
6 years agoNot applicable
Rest API Dynamic Date Query
Hi Everyone. I am having a problem with the Ariba API dynamic time filter. Code is listed below. Source = Json.Document(Web.Contents("https://openapi.ariba.com/api/analytics-reporting-details...
- 6 years ago
Hi Anonymous
You can adjust your code to:
let startMonthDate = Date.StartOfMonth( Date.From( DateTime.LocalNow() ) ) , endDate = Date.AddDays( startMonthDate , -1 ), startDate = Date.AddMonths( startMonthDate , -2 ), endDateText = Date.ToText( endDate, "yyyy-MM-ddT00:00:00Z" ), startDateText = Date.ToText( startDate, "yyyy-MM-ddT00:00:00Z" ), Custom1 = "https://openapi.ariba.com/api/analytics-reporting-details/v1/prod/views/templatename?realm=myrealm&filters={""createdDateFrom"":"& startDateText &",""createdDateTo"":"&endDateText&"}" in Custom1Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
6 years agoCommunity Champion
Hi Anonymous
Are you looking for the current month and previous or last two months?
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Anonymous
6 years agoNot applicable
Hi Mariusz .
Thanks for reaching out.
I am looking for Current Month and last month. Like today its 3 march 2020, so i want it automatically select from 3/01/2020 to 3/03/2020. The format must be json "YYYY,MM,DDTime" .
Thank you.