Hi All
I have an issue trying to filter a sharepoint list using Get Items.
The scenario is the following:
Example. Dates are defined as Dates, no strings.
ExpYear | ExpMonth | StartDate | EndDate | UPSType | BudgetAvailable |
2021 | March | 3/7/2021 | 4/3/2021 | On Going | 25,000 |
2021 | March | 3/7/2021 | 4/3/2021 | New | 50,000 |
So when the flow runs, I need to save the date it started and go to the list to try to get the correct budget based in which date range it falls in and which type it is.
See below how I am filtering the list. The expression I am using is
You don't have single quotes around both dates. I don't remember at the moment whether they are required for date values or not. But I know its one or the other. You have startdate with single quotes and enddate without. If adding single quotes to the enddate target date doesn't work try removing them from both.
Same error. The expression "StartDate ge '2021-03-26' AND EndDate le 2021-03-26" is not valid. Creating query failed.
clientRequestId: a4f0dbc0-22b1-48db-8323-90e0a4bb30be
serviceRequestId: a4f0dbc0-22b1-48db-8323-90e0a4bb30be
Your data filters should be turned around and I think you need to put the target date inside single quotes.
StartDate ge 'formatDateTime(...)' and EndDate le 'formatDateTime(...)'
UPSType is a string! I deleted the UPSType filter but the date filter is still giving error.
I assume UPSType is a choice column right? If so you can't use a complex object in a Filter Query. You've got two options.
1) Do the Filter Query for startDate and EndDate and then do a filter Array to get the specific UPSType.
2) Look at the output of the GetItems. You'll find that the Choice column also reports an ID in the Trigger data that is a simple INT and not a complex object. You can filter on that integer in the Odata query. That simplifies the ODATA filter to one action, but complicates it because you have to figure what the appropriate number is.
I recommend #1.
WarrenBelz
146,771
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional