I am trying to build a Flow that will create a report containing only the items in a list where the Date is today.
Users complete an MS Form to notify Security when a visitor is coming on site with a vehicle. This creates an entry in a SP listt.
The list is items that represent vehicles due on site. One of the columns is simply the date the vehicle is expected. It is provided from a Form date picker.
I attach two screen shots.
The Date In column is just there to show the date in UK format the actual Date column is hidden.
I need to use Get Items to get the items where the Date equals Today.
This Flow will be a scheduled flow which will run early every morning and send a report to Security Staff so they know which vehicles are expected today.
My question is how do I express Todays date so that I can filter my Get Items query?
I guess I am on the right lines of initializing a variable? But Im not sure how to express it.
The trigger in my example is Manual, it will be changed to schedules once I have got this to work.
I believe you would need to use a Filter Array then you can format the SharePoint Date Column so that it looks like:
is equal to
OK so its:
The Date column is in format yyyy-MM-dd
so how do i say "only get items where Date is equal to Today"
I can see an Expression "utcNow()" but that will return a timestamp for now not the value of today's date on its own...
So where you have Date you need to put the below expression like in the screenshot
Then after "is equal to" you will do the same, just with the below expression
Thanks, im beginning to understand how it should work but I get an error saying "the expression is invalid"
I have copied and pasted the expression and manually typed it, same result.
I have studied the expression and it looks OK to me but im pretty new to this.
Sorry that's on me! It should be as below
It was missing the apostrophes either side of Date
Im getting this now:
The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@equals(formatDateTime(outputs('Get_items')?['Date'], 'yyyy-MM-dd'), formatDateTime(utcnow(), 'yyyy-MM-dd'))' failed: 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.
The Date value seems to be correct, here is an example:
Sorry someone in HQ decided we can't use work accounts on here.
In your Get Items within the Filter Query enter Date ne null so that it will only return items that have a Date value assigned to them. This will mean you won't have this error as it won't find any null values.
Check out the News & Announcements to learn more.
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.