web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Returning one value li...
Power Apps
Answered

Returning one value like groupby function

(0) ShareShare
ReportReport
Posted on by 78

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

 

I have the same question (0)
  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard