MSFlow filter SharePoint list in GetItems action by date field


I was attempting to create a flow that executed a GetItems action that would use the ODATA filter field to limit the rows to those where a date field (ProjectEnd) was less than or equal to the current date/time.


I accomplished this by creating a composed string variable that was the filter portion of what will be essentially a REST call to SharePoint.  So if you're familiar with SharePoint REST call formats your goal will be to attain the same result and the query should work.  In this case I needed the REST call to have $filter=ProjectEnd lt '2017-04-27T19:51:38.7610450Z'.  That turned out to be tricky, but knowing that the browser would encode the single quotes anyway I just jumped ahead and did it in my variable.  The resulting variable looks like this: ProjectEnd lt %272017-04-27T19:51:38.7610450Z%27




The result of this Compose can then be attached to the filter of the GetItems.


KEY: when you actually create this compose action item, put (double quotes) " around the value, they do not show once you've saved the flow but are critical to make it work.

1 Reply

This helped me with my flow. Thanks for your post.