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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Emailing a data table ...
Power Apps
Answered

Emailing a data table along with its filters

(0) ShareShare
ReportReport
Posted on by 233

Hello,

In my last post I got my tables and filters working and accepted the solution forgetting my last part about sending an email. For reference here is my pervious post about setting up my table and filters.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Screen-with-multiple-reports-with-filters-and-Email-Option/m-p/821020/thread-id/261428#M261819

 

For the emailing a Table:

I have a data table that can be filtered by a dropdown with three date options. I need to setup an email button that will only email the displayed results in the table after the filter has been selected.

 

 The three date filters are ["This Week", "This Month", "Year to Date"]

The tables Items Property is:

Switch(
 'Date_Filter_VH-C_Dropdown'.Selected.Value,
 "This Week",
 Filter(Etcher_Cleaning_Sheet,'Date and Time'>=DateAdd(Today(),If(Weekday(Today())<>1,-Weekday(Today())+2,-6),Days) && 'Date and Time'<DateAdd(Today(),If(Weekday(Today())<>1,9-Weekday(Today()),0),Days)),
 "This Month",
 Filter(Etcher_Cleaning_Sheet,Year('Date and Time')=Year(Today()) && Month('Date and Time')=Month(Today())),
 "Year to Date",
 Filter(Etcher_Cleaning_Sheet,Year('Date and Time')=Year(Today())),
 Etcher_Cleaning_Sheet
)

 

Thank You.

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Chrisguff12 :

    Do you want to email the filtered table to the specified user?

    If so,I'm afraid this is a bit difficult.The key is that you need to convert the table into HTML format, but PowerApps does not provide this feature. My suggestion is to insert a flow.I've made a test for your reference:

    1\My data table:

    ClearCollect(QQQ,{ID:1,ColumnA:"1",ColumnB:"2"},{ID:2,ColumnA:"1",ColumnB:"3"},{ID:3,ColumnA:"2",ColumnB:"2"},{ID:4,ColumnA:"1",ColumnB:"2"})

    2\Create a flow('PowerApp->ParseJSON,CreateHTMLtable,Sendanemail(V2)')

    1.JPG

    Note:the Schema parameter is depends on the schema of your data source.If you don't know what it is, you can automatically generate it by clicking ‘Generate from sample’ and entering the JSON of your table.

    3\Insert this flow into your app

    2.JPG

    4\Add a button and set it's OnSelect property to

    Set(TheTable,JSON(QQQ));
    'PowerApp->ParseJSON,CreateHTMLtable,Sendanemail(V2)'.Run(TheTable)

    On your side the code should be

    Set(TheTable,JSON(Switch(
     'Date_Filter_VH-C_Dropdown'.Selected.Value,
     "This Week",
     Filter(Etcher_Cleaning_Sheet,'Date and Time'>=DateAdd(Today(),If(Weekday(Today())<>1,-Weekday(Today())+2,-6),Days) && 'Date and Time'<DateAdd(Today(),If(Weekday(Today())<>1,9-Weekday(Today()),0),Days)),
     "This Month",
     Filter(Etcher_Cleaning_Sheet,Year('Date and Time')=Year(Today()) && Month('Date and Time')=Month(Today())),
     "Year to Date",
     Filter(Etcher_Cleaning_Sheet,Year('Date and Time')=Year(Today())),
     Etcher_Cleaning_Sheet
    )));
    'PowerApp->ParseJSON,CreateHTMLtable,Sendanemail(V2)'.Run(TheTable)

    The Result:
    3.JPG

    Best Regards,

    Bof

  • Chrisguff12 Profile Picture
    233 on at

    Hello @v-bofeng-msft,

     

    The filtered table would be sent to several people. I'm not too familiar with flows and having a hard time trying to figure out your steps. I've only tried to use them to covert the PowerApps Expense app to my own data, but I never did get it working. 

     

    1/ Which property on the table do I add this code to? I see on the bottom of your post where you have "On your side the code should be" this sting in not apart of it, or is the test string?

     

     

    ClearCollect(QQQ,{ID:1,ColumnA:"1",ColumnB:"2"},{ID:2,ColumnA:"1",ColumnB:"3"},{ID:3,ColumnA:"2",ColumnB:"2"},{ID:4,ColumnA:"1",ColumnB:"2"})

     

     

    2/ How do I find/ make the ParseJSON or the table/Flow?

    Is it one of the templates do I need to start from a blank flow?

     

     

    Edit:

     

    Ok so I was messing around with Flow and I got the ParseJSON setup the only thing that I missing is the Schema. I'm not sure how to make my table in to the Json.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Chrisguff12 :

    Step1: To get the Schema, you must first get the JSON of your table

    There is a very intuitive method: I have used this formula "Set(TheTable,JSON(QQQ));" to store the JSON of the target Table in the variable TheTable. You only need to add a label and set its Text property to TheTable to get the JSON of the target table.

    Step2: Click ‘Generate from sample’ to automatically get the JSON schema

    1.JPG

    I think this link will help you a lot:

    How to Parse JSON in Microsoft Power Automate 

    Best Regards,

    Bof

     

     

     

     

     

  • Verified answer
    Chrisguff12 Profile Picture
    233 on at

    Hi,  @v-bofeng-msft 

     

    So, I have been messing around with the solutions that you provided and somehow I stumbled into the system working even thou it’s still a little different from what you showed me. A lot of the options in the flow that you suggested and that were in the link you provided were different from what I was seeing.

     

    Anyway, here is what my Flow looks like:

    Chrisguff12_3-1613617446163.png

     

    And the result I get is this:

    Chrisguff12_5-1613617600173.png

     

    Thanks for all you help.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 525 Most Valuable Professional

#2
Haque Profile Picture

Haque 273

#3
Kalathiya Profile Picture

Kalathiya 232 Super User 2026 Season 1

Last 30 days Overall leaderboard