Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
In Part 1 of series we created Canvas app using CDS for Apps and customized screens. In this blog we will cover how to make use of collections and update data in collections. Let’s first understand what collections are.
Collections: Special kind of storage to store group of similar items. For example: List of Companies and Products. Collections data is local to an app and cannot be shared across applications or devices. Collections are useful to store and modify data in offline mode by creating a temporary copy of data. You can store single value as well as table data in collections. Below are functions used when working with Collections:
Refer blog for more details on Collections.
In this blog we will make use of ClearCollect function to store Company Products data. We will then Group By Products by Company and finally we will add new column to store Total number of Products by Company.
Collections helps us to visualize data as well with each transformation
Add Company Products Data Source:
Store Company Products Data in Collection:
Group By Products data by Company:
Company column in Company Products is a lookup column and currently Group By function does not support lookup columns. Therefore to group products data by company, we need to add company name in our collection created above.
ClearCollect(ProductsByCompany,GroupBy(AddColumns(‘Company Products’,”CompanyName”,cr2a5_Company1.cr2a5_companyname),”CompanyName”, “Products”))
Add Column for Products count per Company:
Now data is grouped based on company. We will add new column in collection to hold product count per company
ClearCollect(ProductsByCompany,AddColumns(GroupBy(AddColumns(‘Company Products’,”CompanyName”,cr2a5_Company1.cr2a5_companyname),”CompanyName”, “Products”), “ProductCount”, CountRows(Products)))
Business Applications communities