cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Question about birthday reminder flow

Hi gurus,

 

I am new to Flow, so really appreciate it if anyone of you can help me out here >.<

 

I have an "Employee" list on our SharePoint site where one of the columns is "Birth Date" and another column is "Age" with auto-calculation. Note: the birthda date format below is dd.mm.yyy

flow 1.PNG

 

I made a flow so that I will receive an email 2 days before an employee's birthday is approaching, with information on: who (name) and what age the employee is turning in 2 days. For testing purpose, I changed my own birthday on the list. The flow runs successully but I just didn't receive any email.

 

Can anyone please let me know what has gone wrong here? Many thanks in advance! Here is my flow:

flow 2.PNG

flow 3.PNG

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

Now that I see the field for your birth date is called: 

item()?['F_x00f8_dt']

And the format of the "Get items" output is: 1987-02-27 (yyyy-MM-dd), it is likely there was no need for the "split" afterall.

 

It's probably be best to remove both the compose actions called:

1) "Split Birtday Into 3"

2) "Compose Birthday In ISO 8601 Format"

 

Then making your condition:

formatDateTime(item()?['F_x00f8_dt'], 'MM-dd')

is equal to

addDays(formatDateTime(utcNow(), 'MM-dd'),-2,'MM-dd')

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

14 REPLIES 14
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous , Nice to see someone who is on top of everyones birth dates as you are, maybe I should do this as I rarely remember a birthday. Smiley Wink

 

Edit: Below are the additional steps you will require as your Flow will never match 'dd.MM.yyy' as it is not in ISO 8601 format.

After your SharePoint "Get Items" add the following.

Capture-106.png

split(item()?['Birth_x00200_Date'],'.')
concat(outputs('Split_Birthday_Into_3')[0] , '/' , outputs('Split_Birthday_Into_3')[1] , '/' , outputs('Split_Birthday_Into_3')[2])
equals(outputs('Compose_Birthday_In_ISO_8601_Format'), addDays(utcNow(),-2,'dd/MM/yyyy'))

This changes the date format from dd.MM.yyyy to dd/MM/yyyy which is inline with the ISO hence the operators will work as expected.

Please see Standard Date and Time Format Strings for more information.

 

If you have found my post helpful, please mark thumbs up.

If this post has solved your problem, please click "Accept as Solution".

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

Just wondering how you got on with this? Would you mind providing an update once you've had a chance to implement or come back if you have any questions please.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Anonymous
Not applicable

Hi @AlanPs1 , thank you so much for your reply!

 

I implemented the changes as per your suggestion, and it looks like this now:

new flow.png

 

However the testing failed with the following error - any idea??

Error.PNG

 

Best regards,

Mitty

AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

In your SharePoint List, what is the "type" of your column. See below for a reference.Capture-200.png

Also, can you show me the output of your "Get Items" ... something like the below is what I am looking for.Capture-201.png

Or, copy and past the whole JSON output and paste it back in the chat.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Anonymous
Not applicable

Hi Alan,

The type of my "Birth Date" column is Date and Time

The Peek Code for my "Get Items" is:

 

{
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['shared_sharepointonline']['connectionId']"
}
},
"method": "get",
"authentication": "@parameters('$authentication')"
},
"metadata": {
"flowSystemMetadata": {
"swaggerOperationId": "GetItems"
}
}
}

 

AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

I am looking for the below.Capture-202.png

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Anonymous
Not applicable

Hi @AlanPs1 ,

Hope you have had a good weekend!

See if this is what you are after?

Untitled picture.png

Untitled picture 2.png

AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous , I hope you had a good weekend too.

In post 4, you have written "However the testing failed with the following error - any idea??"

Below this there is an image. You captured this image by going into a previous run and expanding the error on Split Birthday intro 3. I am hoping you can do the same but on the previoyus step, get items. I am looking for the JSON Output of that on a successful or failed run so I can see it's output.

Please reply with that if possible.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Anonymous
Not applicable

Hi again @AlanPs1 

Thank you for your patience! Here you go:

Untitled picture 3.png

 

Below is the Body text that is relevent for my own record. Something is wiered: 1) I have changed the column name from "Født" to "BirthDate" and refershed several times, but the output text still indicates the old name "Født". 2) the date output file is yyyy-mm-dd

Capture 1.PNG

AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

can you try changing this:

item()?['Birth_x00200_Date']

to this (wherever it is being used)

item()?['F_x00f8_dt']

It looks like the naming behind the column maintains item()?['F_x00f8_dt'] ... so give it a try and report back please.

 

If you find my posts helpful, please mark with thumbs up

If this solves your issue, please click "Accept as Solution"

Any questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Anonymous
Not applicable

Thanks again @AlanPs1 !

Found that only "Split Birthday Into 3" needs this change. So the updated version as follows:

Capture 2.PNG

 

However the flow testing still failed with exactly the same error meesage at the same step...T.T

Untitled picture 4.png

AlanPs1
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

Now that I see the field for your birth date is called: 

item()?['F_x00f8_dt']

And the format of the "Get items" output is: 1987-02-27 (yyyy-MM-dd), it is likely there was no need for the "split" afterall.

 

It's probably be best to remove both the compose actions called:

1) "Split Birtday Into 3"

2) "Compose Birthday In ISO 8601 Format"

 

Then making your condition:

formatDateTime(item()?['F_x00f8_dt'], 'MM-dd')

is equal to

addDays(formatDateTime(utcNow(), 'MM-dd'),-2,'MM-dd')

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

Anonymous
Not applicable

Thanks again @AlanPs1 !

I've changed the Flow as suggested below, but still don't get emails 😞

The codes used in Condition is:

@equals(formatDateTime(items('Apply_to_each')?['F_x00f8_dt'], 'MM-dd'), addDays(formatDateTime(utcNow(), 'MM-dd'), -2, 'MM-dd'))

Untitled picture5.png

Anonymous
Not applicable

Hi again @AlanPs1 

Hope you have had a good weekend!

Would like to let you know that the birthday reminder flow works! But in a slightly different way Man Tongue

For testing purpose I set my birthday to 1 March with this condition:

@equals(formatDateTime(items('Apply_to_each')?['F_x00f8_dt'], 'MM-dd'), addDays(formatDateTime(utcNow(), 'MM-dd'), -2, 'MM-dd'))

However the reminder didn't come 2 days before 1 March as expected; instead it arrived on 3 March, which is 2 days AFTER the "birthday", and the Age is in a wired format even though the column setting used 0 decimal Smiley LOL

birthday reminder mail.png

I therefore changed my birthday again as well as the condition from "-2" to "2" and see if it will work normally. 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,267)