Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Returning one value like groupby function

(0) ShareShare
ReportReport
Posted on by 72

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

 

  • Verified answer
    EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Returning one value like groupby function

    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 15 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics