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

Canvas App - Today postings

My canvas app is having button in which onlick action is to extract all table data and send it to email as csv attachement.

Following is codings which working fine.

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"),"Created On",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"Created On","bbd","crf99_materialdesc","Materialno","Qty"))))

What  i want in this is only to  extract today date postings. trying to change i could not.

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @AVTS ,

 

Could you please share more details about your scenario? Are you using Dataverse as the data source? Is the createdon column the system column with Date and Time type?

 

If Dataverse tables are the data sources and createdon is a Date and Time column, when there are more than 2000 items in this table you will meet the delegation issue because Date and Time column is non-delegable.

 

But first to resolve the issue on your demand, please try:

Test1.Run(User().Email,JSON(With( {TheTable:Filter(ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty"),DateDiff('Created On', Today(),Days) =0)}, ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),"Created On",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"Created On","bbd","crf99_materialdesc","Materialno","Qty"))))

 

To solve the delegation issue, please refer to below video:

https://www.youtube.com/watch?v=eCMuXPI1Qok

 

Also you could consider add a new Date only type column into the table, set the value to be the created date only before submitting in the form. If there is a Date only column say CreatedDate in the table, the formula could be:

Test1.Run(User().Email,JSON(With( {TheTable:Filter(ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty"),CreatedDate = Today())}, ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),"Created On",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"Created On","bbd","crf99_materialdesc","Materialno","Qty"))))

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @AVTS ,

 

Could you please share more details about your scenario? Are you using Dataverse as the data source? Is the createdon column the system column with Date and Time type?

 

If Dataverse tables are the data sources and createdon is a Date and Time column, when there are more than 2000 items in this table you will meet the delegation issue because Date and Time column is non-delegable.

 

But first to resolve the issue on your demand, please try:

Test1.Run(User().Email,JSON(With( {TheTable:Filter(ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty"),DateDiff('Created On', Today(),Days) =0)}, ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),"Created On",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"Created On","bbd","crf99_materialdesc","Materialno","Qty"))))

 

To solve the delegation issue, please refer to below video:

https://www.youtube.com/watch?v=eCMuXPI1Qok

 

Also you could consider add a new Date only type column into the table, set the value to be the created date only before submitting in the form. If there is a Date only column say CreatedDate in the table, the formula could be:

Test1.Run(User().Email,JSON(With( {TheTable:Filter(ShowColumns(Dailyinventory,"crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty"),CreatedDate = Today())}, ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),"Created On",Last(NewGroup).createdon,"bbd",Last(NewGroup).crf99_bbd,"Materialno",First(NewGroup).crf99_materialno,"Qty",Sum(NewGroup,crf99_qty)),"Created On","bbd","crf99_materialdesc","Materialno","Qty"))))

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

thanks looks fine.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (58,511)