cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Helper V
Helper V

Canvas App - Send data to Email from Table

Hi,

I am having following table records.

 

AVTS_0-1619977874397.png

Requirement. 

 

Button click same table data should goes as email attachment to the power app logged-in user email id.

 

Note : Data should be created by today and it should consider old datas.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AVTS :

Try:

Test1.Run(

      User().Email,

      JSON(ShowColumns('DailXXX',"MatXXX1","MatXXX2"))

)

Best Regards,

Bof

View solution in original post

28 REPLIES 28
v-bofeng-msft
Community Support
Community Support

Hi @AVTS :

Could you tell me:

  Do you want to email the specified form to the current user?

If so,My suggestion is to use Flow to convert the table into HTML format. I've made a test for your reference:

1\My table:

ClearCollect(
   TheTable,
   {sno:1000,Status:"Active",'TODAY QTY':12,'YES QTY':3,'MIKE':4352354,desc:"TSJIR4",'Created on':Date(2021,5,3)},
   {sno:1001,Status:"Active",'TODAY QTY':9,'YES QTY':4,'MIKE':4352354,desc:"Lkie1",'Created on':Date(2021,5,3)},
   {sno:1002,Status:"Active",'TODAY QTY':12,'YES QTY':5,'MIKE':4352354,desc:"TSJIR4",'Created on':Date(2021,4,20)},
   {sno:1003,Status:"Active",'TODAY QTY':9,'YES QTY':6,'MIKE':4352354,desc:"Lkie1",'Created on':Date(2021,5,21)}
)

2\I assume you want to get the items whose creation date is today,the filter formula should be:

Filter(TheTable,'Created on'=Today())

*Step 1&2 does not require you to operate,it is to facilitate your understanding*

3\Create a flow-'PowerApp->Initializevariable,Initializevariable2-2'

1.PNG

Reference Expression:

json(variables('TheTable'))

4\Insert the flow into your app:

2.PNG

5\Create a button and set it's OnSelect property to:

'PowerApp->Initializevariable,Initializevariable2-2'.Run(
          User().Email,
          JSON(Filter(TheTable,'Created on'=Today()))
)

The Result:

3.png

Best Regards,

Bof

thanks . it will go as excel attachement ?

Hi @AVTS :

Nope. My solution is to directly convert the table into HTML format and present it directly in the body of the email.

looks like:

3.png

If you need to create an excel file and then send it as an attachment, it will be a little difficult, I suggest you refer to this link.

Best Regards,

Bof

v-bofeng-msft
Community Support
Community Support

Hi @AVTS :

Has your problem been solved?
If my answer is helpful, please consider marking it as "Solution" to help others.

Best Regards,

Bof

Hi thanks for your quick respose. Ifcourse partialy your code solved my issue. But i am keeping this open since i need to get the excel attachment instead of HTML.

Hi @AVTS :

Fine.I have found a more simpler way.

Please try this flow:

1.PNG

Reference Expression:

json(variables('TheTable'))

The Result

2.PNG3.png

Best Regards,

Bof

I am getting following error ,

 

Unable to process template language expressions in action 'Create_HTML_table' inputs at line '1' and column '8180': 'The template language function 'json' parameter is not valid. The provided value 'Initializevariable2-2' cannot be parsed: 'Error parsing Infinity value. Path '', line 1, position 2.'. Please see https://aka.ms/logicexpressions#json for usage details.'.

 

Where is the real table is mentioned here?

Hi @AVTS :

I suggest you consider providing all the details (all your steps and settings) so that I know how to help you

Best Regards,

Bof

Sure,Flow Test during HTML table. Trying to understand how is it extracing the data from table  since i do not see any datasource connectivity here? Dailyinventory is datasource name.

AVTS_1-1620030952172.png

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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,142)