Forum Discussion
filter by date on Odata query
- 1 year ago
Please read the documentation. Use the Query parameter. You are still trying to stuff the filters in the base URL.
- venBI1 year agoFrequent Visitor
Thanks for you response, I have tried some this like this but still ends up with same error.
let
// Construct the full URL with query parameters
ODataUrl = "mylink/_odata/v4.0-preview/WorkItemSnapshot?" &
"$filter=" & Uri.EscapeDataString("(WorkItemType eq 'Defect' or WorkItemType eq 'Task' or WorkItemType eq 'User Story' or WorkItemType eq 'Bug') and " &
//"DateValue ge " & IterationStartDate & " and DateValue le " & IterationEndDate & " and " &
"DateValue ge @IterationStartDate and DateValue le @IterationEndDate )" &
"&$select=WorkItemId,StoryPoints,WorkItemType,Title,State,Custom_Status,DateValue,ClosedDate" &
"&$expand=Iteration,Area",// Source with query parameters
Source = OData.Feed(
ODataUrl,
null,
[
Implementation = "2.0",
Query = [
// Calculate the start date (6 weeks ago)
#"@IterationStartDate" = DateTime.ToText(Date.AddWeeks(DateTime.LocalNow(), -6), "yyyy-MM-ddTHH:mm:ssZ"),
#"@IterationEndDate" = DateTime.ToText(DateTime.LocalNow(), "yyyy-MM-ddTHH:mm:ssZ")
]
]
)
in
Source- lbendlin1 year agoSuper User
Please read the documentation. Use the Query parameter. You are still trying to stuff the filters in the base URL.