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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,497)