cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Super User
Super User

Canvas App - Sum up the dual items

I have canvas app. inwhich i have button click to send csv attachement to email. 

 

My Table follows,

AVTS_1-1620248200343.png

 

Button Onselect formula,

 

Test1.Run(User().Email,JSON(ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty")))

 

Currenty  : Reports shows same as table.

Expected :  Dual line item same material no qty should merged while sending report.

 

examplebelow

 

Multi line item Water 13 , Water 19s are merged togther in the report.

 

AVTS_2-1620248299598.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @AVTS :

please try:

 

Test1.Run(User().Email,JSON(

With(

 {TheTable:ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty")},

 ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),"CreateOn",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"CreateOn","bbd","crf99_materialdesc","Materialno","Qty")

 )

)

 

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @AVTS :

please try:

 

Test1.Run(User().Email,JSON(

With(

 {TheTable:ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty")},

 ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),"CreateOn",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"CreateOn","bbd","crf99_materialdesc","Materialno","Qty")

 )

)

 

Best Regards,

Bof

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (7,220)