Notifications
Announcements
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");
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
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
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>";
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 717 Most Valuable Professional
Michael E. Gernaey 329 Super User 2025 Season 2
Power Platform 1919 268