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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Column alias in Xrm.We...
Power Apps
Unanswered

Column alias in Xrm.WebApi.retrieveRecord

(0) ShareShare
ReportReport
Posted on by 305

Is it possible to have an alias for the columns retrieved in  Xrm.WebApi.retrieveRecord ?

 

This syntax isn't working 

 

Xrm.WebApi.retrieveRecord("jg_tdssection", tdsSectionId, "?$select=jg_rateforindividuals as jg_tdsrate");

 

I have the same question (0)
  • Shashank Bhide Profile Picture
    942 Moderator on at

    that's more an OData query than a Dataverse query and OData committee doesn't support column aliasing yet AFAIK.

     

    https://stackoverflow.com/questions/20666056/alias-in-odata-select-statement

     

  • Rutu01 Profile Picture
    305 on at

    According to the docs here   https://devblogs.microsoft.com/odata/compute-and-search-in-asp-net-core-odata-8/ 

    this should work : 

    GET http://localhost:5102/odata/products?$compute=Price mul Qty as TotalPrice&$select=TotalPrice

    but it didn't for me 

    ?$compute=jg_ratefornonindividuals mul 1 as tdsrate & $select=tdsrate

    I'm getting this error : The query parameter [REDACTED] is not supported

  • Verified answer
    Shashank Bhide Profile Picture
    942 Moderator on at

    that link is from ASP.NET core's OData implementation, different implementers may choose to implement different features, but for Dataverse I didn't see any online documentation which suggests it's available.

     

    using fetchXML though aliasing is supported.

    string fetchXml = @"<fetch top='3'>
     <entity name='account'>
     <attribute name='accountclassificationcode' alias='code' />
     <attribute name='createdby' alias='whocreated' />
     <attribute name='createdon' alias='whencreated' />
     <attribute name='name' alias='companyname' />
     </entity>
     </fetch>";
  • Rutu01 Profile Picture
    305 on at

    I couldn't find any information about alias being supported here https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api so perhaps it's not

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard