I am trying to create a flow which send an email at the start of each week (Sunday) of who's birthday it is of that week.
I have created this:
I created two formulas for the start of the week and end of the week - and having someone's birthday be greater than or equal to or less than or equal to - so essentially only giving me true outputs for birthdays within that week.
These are the formulas I wrote:
When I have the output of the condition in a compose it gives me two true birthdays (which is correct). But when I change that compose to an email to be sent to myself, the flow ends up sending me everyone's birthday, false and true. Which doesn't make sense to me, considering previously the compose gave me two birthdays that were true?
Has anyone come across a problem like this? Is there a better way to read information for the following week?
Solved! Go to Solution.
I suggest using the oData date filter directly on List rows itself as that would be more optimized than something like below
you can pass the composed dates to list rows with format as below
Birthdate gt '2022-07-10T00:00:00' and Birthdate lt '2022-07-16T23:00:00'
Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.
Hi @Shujaath_Khan ,
I've just noticed that the birthdays are in yyyy-dd-MMT00:00:00 format. Which means that it can't equal dates between a compose that has this year (2022).
Hi, @DynamicsHS, you'll have a *much* easier time if you work with ticks().
It will more easily allow you to discern what it greater/less than a number, rather than worry about actual days.
So, here you could:
Now you have also skipped unecessary loops, too!
* I've starred this because to be even more 'on it' you could create a column/field/whatever that has the ticks value in the table. Then you can simply filter the table by that number.
This is the ISO8601 standard for date formats, @DynamicsHS, all you would need to do is be a little more specific and/or prosaic in your date creation here.
Once you know what you're trying to do, you can use logic to get there with if() and concat() functions in any expression.
Hi @eliotcole ,
Could you please explain what you mean by the format issue ?
I am grabbing the cdm_birthdate and converting it to the correct Timezone and only grabbing the dd/MM
I then have the start of the week and the end of the week as shown in my link in a compose - which gives the right dates I want (10/07-16/07)
I am then using a condition with the converted Timezone birthday to be greater than and equal to the start of the week and less than and equal to the end of the week. With the idea that only birthdates within that week will be ‘true’.
But for some reason it is pulling birthdates that are outside of the this week (10/07 - 16/07).
I’m hoping to create a flow that runs every Sunday or Monday and retrieves the birthdays of that week. If that is possible ?
I'm not particularly willing to go in deep on this, because I believe that using ticks() is a MUCH simpler solution, but essentially you can just build the date by creating some things automatically, and defining some things with a string of text.
For example if I wanted to have a generic time value always be tomorrow at 0100 I'd add a day to the time, but format it only as "yyyy-MM-dd", then concat in the string "T01:00:00.0000000Z".
Don't take that too literally, though, just see it as an example of what I'm talking about, here.
Still ... use the ticks() method ... seriously ... do some test flows, you'll see how much more apt it is to the situation.
That's because it's doing it for every one of them.
If you run a select on the 'list rows' action, then you could create a new array which you will be able to add a 'column' (key) with values that you can add/minus the appropriate amount of time from the source time. That may be the easiest solution there.
I'm working on a similar project right now with sending out automated birthday emails. Thank you so much for posting your solution, Henry--it's helping me out a lot!
That being said, I'm running into some issues with excluding the year/converting my birthdays to be in MM/dd format. Doesn't using the short date format include the year, which would exclude the birthdate from the conditional in your flow?
What I want my flow to do is check if there are birthdays happening this week. If there are, email the employee's supervisor with the birthday(s). If not, don't send an email. I think I have the supervisor part down okay, but things get stuck when it tries to compare birthdays to the beginning/end of the week variables.
Here's what I have:
Right now, this setup gives me the following error: Evaluation of inputs for the expression action of kind 'ConvertTimeZone' failed: 'Required property 'baseTime' expects a value but got null. Path ''.'.
I'm pretty new, so sorry if I'm missing something blatantly obvious! Thank you in advance for any help.
Hi @piccolini ,
Could you change the initialize variables to