Post a Teams message, when Excel online criteria is met.

Steel Contributor

Hi,

 

The idea/problem I would like to solve is to post a message everyday if a criteria is met.

 

Th Excel online Sheet

excel bursdag.PNG

 

Column "Bursdag i dag" (Birthday today) is set to yes ithe person have birthday.

 

The flow:

 

Scheduled to run everyday

 

Check if the column is "ja"

bursdag i dag.PNG

 

Post a message at Teams:

poste bursdag.PNG

 

I Guess the way I check column value in Excel is wrong here. Is this scenario possible? If yes, how do I configure it?

 

Best Regards

- Geir

 

2 Replies

@Geir Hogstad

 

Solved it, changed to "List Rows.."

 

Best Regards

- Geir

@Geir Hogstad I would do it a different way so you don't have to manually check the spreadsheet and add in if it's the person's birthday - you can get the flow to check that.

 

Make sure your spreadsheet has the full date of the next birthday and that the rows are formatted as a table:

0-Table.png

 

In your flow, as you've realised, you need to use the List rows present in a table action:

 

1-Flow.png

 

Then add an apply to each and select value from the dynamic content.

 

Next add 2 Compose controls:

1.  I've renamed the first one to ConvertedDate and its purpose is to convert the date from Excel's integer format to something you can use in the flow. So you need an expression which will be:

formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['NextBirthday']),-2)), 'yyyy-MM-dd')

 

When you are comparing dates you must always have them in yyyy-MM-dd format.

 

2. The second Compose, called Today, gets today's date and puts it into yyyy-MM-dd format for the comparison. The expression is 

formatDateTime(utcNow(),'yyyy-MM-dd')

 

2-Flow.png

 

Finally, add a Condition to check if the converted date is the same as today's date. In the left field select the ConvertedDate output from the dynamic content, and in the right field select the Today output from the dynamic content.

 

In the green if yes channel add your Teams Post a message action

 

3-Flow.png

 

And this is the result in your Teams channel:

4-Result.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User