Hello Everyone
We are moving our back end from Sql to Common Data service
I have developed a Powerapp which used a sql View which would return one value (ie similar to a groupby function) from a group of records
Example
GUID OBSERVATION DATE Result Submitted By Question
1234 10-08-2020 yes me@help.com Q1a
1234 10-08-2020 no me@help.com Q1b
1234 10-08-2020 no me@help.com Q1c
I was able to create a view in SQL and in that view I had the GUID and observation Date and the submitted by in one row
and therefore itwould return
GUID OBSERVATION DATE Submitted by
1234 10-08-2020 me@help.com
and then I would use it in my powerapp
I would like to know how can I do that in the common data service
Hi @mpezzutti,
You can achieve that with FetchXml queries. Below is an example. More on FetchXml groupby: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/use-fetchxml-
<fetch distinct="false" mapping="logical" aggregate="true" >
<entity name="entity" >
<attribute name="ID" alias="Guid" groupby="true" />
<attribute name="observationdate" alias="ObervationDate" groupby="true" />
<attribute name="submittedby" alias="SubmittedBy" groupby="true" />
</entity>
</fetch>
There's a tool in XrmToolBox called FetchXmlBuilder to facilitate building your FetchXml queries and also View Designer tool to build/edit a CDS views. You can create a CDS view with that FetchXML and then (I haven't tried this but it should work) in your Canvas App, reference that view from your data source. Here's an article on this for more: info: https://www.inogic.com/blog/2019/10/show-dynamics-365-crm-views-in-canvas-app-using-cds/
Hope this helps!
stampcoin
17
mmbr1606
15
Super User 2025 Season 1
ankit_singhal
11
Super User 2025 Season 1