web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create HTML table base...
Power Automate
Answered

Create HTML table based on excel data

(0) ShareShare
ReportReport
Posted on by 103

Hi

 

I am brand new to this and need any help You could please.

 

I have an excel table with two date columns. I am trying to search the columns to find a date that equals todays date (1/3/23).

 

Then I want to email a html table to the email address on the row.

 

AM1974_1-1677676096553.png

Therefore Smith would get an email like

 

Site Name

Site1

Site3

Site 7

 

because all these rows match todays date.

 

My flows is:

 

AM1974_2-1677676246125.png

 

AM1974_4-1677676349730.png

 

This isn't working.

 

1. I am getting an email for every date that equals today.

 

2. I am getting the full table in the emails including ones where the date does not equal today.

 

How do I get one email to be sent that just shows the correct lines that equal todays date please?

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-liwei-msft Profile Picture
    on at

    Hi @AM1974 

     

    I have made a test for your reference:

    1.If you want to get today's date, you can use the utcNow function.
    But the utcNow function returns the UTC time zone, which may be different from your time zone, you can use the addHours function.
    I'm using addHours(utcNow(),8,'yyyy-MM-dd') here because I'm in UTC+8 timezone. ('yyyy-MM-dd' limited date format)

    vliweimsft_0-1677722962417.png

    2.

    vliweimsft_1-1677723224707.png

    union(body('Select'),body('Select'))

    3.Use expressions in advanced mode of Filter array:

    vliweimsft_2-1677723283633.png

    @and(equals(items('Apply_to_each'), item()?['Email']),or(equals(formatDateTime(item()?['Date2'], 'yyyy-MM-dd'), outputs('Compose')),equals(formatDateTime(item()?['Date1'], 'yyyy-MM-dd'), outputs('Compose'))))

    4.

    vliweimsft_3-1677723415928.png

     

    Best Regards,

    Levi

     

  • AM1974 Profile Picture
    103 on at

    Thanks for your help. I was getting the following error so I changed DateTime Format to ISO 8601 under List Rows Present in a table.

     

    InvalidTemplate. The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@and(equals(items('Apply_to_each'), item()?['Email']),or(equals(formatDateTime(item()?['Date2'], 'yyyy/MM/dd'), outputs('Compose')),equals(formatDateTime(item()?['Date1'], 'yyyy/MM/dd'), outputs('Compose'))))' failed: 'In function 'formatDateTime', the value provided for date time string '44986' was not valid. The datetime string must match ISO 8601 format.'.

     

    The flow then works but I just get a blank email with no html table. My flow is now:

    AM1974_0-1677753445034.png

     

    AM1974_2-1677753506613.png

     

    AM1974_3-1677753541085.png

    @And(equals(items('Apply_to_each'), item()?['Email']),or(equals(formatDateTime(item()?['Date2'], 'yyyy/MM/dd'), outputs('Compose')),equals(formatDateTime(item()?['Date1'], 'yyyy/MM/dd'), outputs('Compose'))))

     

    AM1974_4-1677753594658.png

     

    Any more help much appreciated.

  • v-liwei-msft Profile Picture
    on at

    Hi @AM1974 

     

    According to your screenshot, you need to write the formula in Compose into the expression.

    vliweimsft_0-1677826656703.png

     

    Best Regards,

    Levi

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard