Skip to main content

Notifications

Community site session details

Community site session details

Session Id : lCvWcPoXpVo0pH6FMu+soQ
Power Automate - Building Flows
Answered

HTML Table in an Email always contains all items instead of a single item

Like (0) ShareShare
ReportReport
Posted on 20 Oct 2021 11:42:11 by

Dear all,

 

Use Case:

I am building a flow to send an email 2 weeks before expiration of a certificate to the contact person of that item.

The table is a SharePoint List with 3 columns: Identification No, Valid Until, Contact Person.

 

Issue:

The html table always contains all items during that reporting time. So different contact persons always get all certificates expiring even they are not responsible for it.

 

Here is what I created:

 

Fn7a_0-1634729687304.png

Fn7a_3-1634729885238.png

Fn7a_4-1634729919831.png

Email Body contains: Outputs of HTMLTableStyling (CSS) and CleanHTML (to have a proper HTML table)

 

It would be great to have one email by contact person (containing all items expiring), but not containing these items which are not related to that contact person.

 

Could anyone tell me what I forgot to consider?

Thank you!

 

  • Community Power Platform Member Profile Picture
    on 22 Oct 2021 at 05:44:09
    Re: HTML Table in an Email always contains all items instead of a single item

    Even after recreating the column without blank space in between and using _x0020_ i run into the same issue. Thats how my column is configured. Anything different to yours?

    Fn7a_0-1634881418779.png

     

     

    This is the overall overview of my flow:

    Fn7a_1-1634881534638.png

     

    Similar to yours:

    Fn7a_2-1634881580943.png

     

     

    Thanks

  • v-LilyW-msft Profile Picture
    on 22 Oct 2021 at 01:36:27
    Re: HTML Table in an Email always contains all items instead of a single item

    Hi @Anonymous 

    I tested it on my side and can get the name of the user. Please check if the internal name of your ‘Contact Person’ column is ‘ContactPerson’.

    vLilyWmsft_0-1634866295585.png

    vLilyWmsft_1-1634866310138.png

    Best Regards.

     

  • Community Power Platform Member Profile Picture
    on 21 Oct 2021 at 10:38:39
    Re: HTML Table in an Email always contains all items instead of a single item

    Hi @v-lilyw1-msft  / @v-LilyW-msft,

    thank you for this suggestion, but even this did not fix it:

    Fn7a_0-1634812680290.png

    Fn7a_1-1634812703125.png

    Any other idea?

     

     

  • v-lilyw1-msft Profile Picture
    2 on 21 Oct 2021 at 09:42:32
    Re: HTML Table in an Email always contains all items instead of a single item

    Hi @Anonymous 

    Please use: item()?['ContactPerson/DisplayName'] and try again.
    Best Regards.
  • Community Power Platform Member Profile Picture
    on 21 Oct 2021 at 09:26:20
    Re: HTML Table in an Email always contains all items instead of a single item

    Ok this is far to complex for me to build it on my own without your guidance. I am still going through it step by step to understand every action done. 

     

    I was able to copy what you did with success. Many thanks for this detailed instruction!

    The only open question I have is, how to include the Name of the Contact Person in the HTML table.

    I managed to add a link to the item: 

    Fn7a_0-1634808060669.png

    But item()?['ContactPerson'] or item()?['Contact_x0020_Person'] or item()?['Contact_x0020_Person']?['Value'] did not work. Any suggestions?

     

    Thanks

  • Verified answer
    v-LilyW-msft Profile Picture
    on 21 Oct 2021 at 03:02:49
    Re: HTML Table in an Email always contains all items instead of a single item

    Hi @Anonymous 

    If you want to send an email to Person(containing all items expiring), but not containing these items which are not related to that contact person. You can take a try with the following screenshots.

    This is my test list.

    vLilyWmsft_0-1634784652384.png

    Flow in details:

    vLilyWmsft_1-1634784692103.png

    vLilyWmsft_2-1634784717494.png

    vLilyWmsft_3-1634784908429.png

    Expression:items('Apply_to_each')['ContactPerson/Email']

    vLilyWmsft_4-1634784923209.png

    vLilyWmsft_5-1634785006957.png

    vLilyWmsft_6-1634785042332.png

    vLilyWmsft_7-1634785075273.png

    You can add HTMLTableStyling, I'm ignoring it here.

    vLilyWmsft_8-1634785113037.png

    After flow runs, Test2 and Litest will receive the following emails separately.

    vLilyWmsft_9-1634785271454.png

    vLilyWmsft_10-1634785288782.png

    Hope the content above may help you.

    Best Regards

    If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on 20 Oct 2021 at 13:26:23
    Re: HTML Table in an Email always contains all items instead of a single item

    Dear @PrasadAthalye ,

    thank you for your suggestions, but I am not sure if I got what you explained in your post and how to reflect it properly. I am pretty new to this.

     

    According to your first paragraph I did this:

    Fn7a_0-1634736247487.png

     

    Since I did not get the second paragraph at all I was just guessing:

    Fn7a_1-1634736329705.png

     

    Could you please guide me through your suggestion based on these screenshots?

    Thank you

  • PrasadAthalye Profile Picture
    4,795 on 20 Oct 2021 at 11:56:19
    Re: HTML Table in an Email always contains all items instead of a single item

    Create a Array variable and run a loop on output from GetItems. Then add a condition to check if Person name has been already added to array variable or not using exist condition. If not, Add it. This way, you can collect all unique contact people.

     

    Then run a loop on this array variable for each item and use filter array condition to filter GetItems output for that person which will give you rows related to that person. Then you can build your HTML and send email notification.

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard