I'm hoping that someone can advise me on how to create a dynamic variable based on the current date that I can compare against a date stored in a sharepoint list. My scenario is that I need to send out a yearly reminder to renew an approval request. I need my flow to check a list daily, identify if there items for which the date in my 'Date Approved' column match the current date, and if so, send an email reminder for each.
I haven't worked much with scheduled flows or the recurrence trigger, so any advice on how to get started and/or links to tutorials that directly apply to my scenario would be appreciated. Thanks in advance!
Solved! Go to Solution.
Based on the error message the filter you used is completely different from what I sent you, it seems you're not even using expression, it's missing commas and apostrophes....
If your column contains also time, then you can't use 'eq' in the filter, you need to define a range, expiration date is greater or equal today and less than tomorrow, that will give you all items from today's 00:00 until 23:59.
ExpirationDate ge 'utcNow('yyyy-MM-dd')' and ExpirationDate lt 'addDays(utcNow(),1,'yyyy-MM-dd')'
To clarify, the values I get when I try to add the current date and the date from my column as variables are not comparable. The date from the column includes the time, even though time is turned off for that column.
Power Automate has an expression utcNow() that gives you the today's date. I'd use filter:
DateApproved eq 'utcNow('yyyy-MM-dd')'
with the assumtions:
The actual reminder sending flow is quite straightforward, unless you need some other functionality than just to send a notification.
Edit: so 'Date Approved' == ExpirationDate? It doesn't make sense why it would contain time if it's Date Only column.
Thank you!
I wasn't clear at first, the problem is that even though the column is set as Date only, it returns a value with time included (you can see in the screenshot below. When I tried the formula you suggested I got this error (I assume because the values weren't comparable).
The expression "ExpirationDate eq. formatDateTime(utcNow()2020-10-29)" is not valid. Creating query failed.
clientRequestId: daaab908-4d7d-484d-94ce-aa5cbbd6156a
serviceRequestId: daaab908-4d7d-484d-94ce-aa5cbbd6156a
Based on the error message the filter you used is completely different from what I sent you, it seems you're not even using expression, it's missing commas and apostrophes....
If your column contains also time, then you can't use 'eq' in the filter, you need to define a range, expiration date is greater or equal today and less than tomorrow, that will give you all items from today's 00:00 until 23:59.
ExpirationDate ge 'utcNow('yyyy-MM-dd')' and ExpirationDate lt 'addDays(utcNow(),1,'yyyy-MM-dd')'
Thank you so much! This works 🙂 As you can tell I'm very new with using expressions - I appreciate you taking the time to help!
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
45 | |
44 | |
38 | |
33 | |
25 |
User | Count |
---|---|
48 | |
35 | |
32 | |
32 | |
29 |