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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Saved Query Not Returning All Columns via Web API

(0) ShareShare
ReportReport
Posted on by

Forgive me if this has been covered somewhere already; a cursory search says it hasn't, but I may have missed it. I have a user query (a saved Advanced Find) that I'd like to retrieve via the Web API, ultimately using the data in Power BI. However, the fields returned when I either execute the Fetch XML (via FetchXML Builder) or via sending a get request via the browser, I get different results than when I run the Advanced Find via the UI, namely, that columns are missing from the results of the two former methods. Any ideas? Below you will find the FetchXML of the query, relevant screenshots, and the JSON returned by the query. 

The FetchXML:

<fetch version="1.0" top="10" >
  <entity name="opportunity" >
    <attribute name="elcn_academicprogramofinterestid" />
    <attribute name="createdon" />
    <attribute name="opportunityid" />
    <attribute name="parentcontactid" />
    <order attribute="elcn_academicprogramofinterestid" descending="true" />
    <link-entity name="contact" from="contactid" to="parentcontactid" alias="a_4e29b74a612a43f0969e0b8e08ce7e48" >
      <attribute name="regent_firstcontactdate" />
      <attribute name="createdon" />
      <attribute name="regent_contactstatus" />
      <attribute name="datatel_prospectsourceid" />
      <attribute name="regent_leadsourcedetails" />
      <attribute name="regent_leadsource" />
      <filter type="and" >
        <condition attribute="createdon" operator="this-fiscal-year" />
        <condition attribute="customertypecode" operator="eq" value="200000" />
        <condition attribute="statecode" operator="eq" value="0" />
      </filter>
    </link-entity>
  </entity>
</fetch>

The JSON returned by navigating to .../api/data/v8.0/opportunities?userQuery=8f518d26-db4a-e711-80c1-e0071bf8e783 (GUID of Advanced Find)

{
  "@odata.context": "https://###.###.###/CRMRECRUIT/api/data/v8.0/$metadata#opportunities(createdon,_parentcontactid_value,_elcn_academicprogramofinterestid_value,opportunityid)",
  "value": [
    {
      "@odata.etag": "W/\"270469221\"",
      "createdon": "2017-03-02T17:30:37Z",
      "_parentcontactid_value": "6df9e349-3960-404b-af80-03d096a942fe",
      "_elcn_academicprogramofinterestid_value": "367f7329-fbf1-e511-80c4-0050569b65f8",
      "opportunityid": "1c983ded-6dff-e611-80cd-e0071bf2c07b",
      "a_4e29b74a612a43f0969e0b8e08ce7e48_x002e_createdon": "2017-03-02T17:30:29Z",
      "a_4e29b74a612a43f0969e0b8e08ce7e48_x002e_regent_firstcontactdate": "2017-03-02T17:30:38Z",
      "a_4e29b74a612a43f0969e0b8e08ce7e48_x002e_regent_contactstatus": 653410002,
      "a_4e29b74a612a43f0969e0b8e08ce7e48_x002e_datatel_prospectsourceid": "947c3a05-77d3-e611-80c0-e0071bf8e783"
    },
... Etc...

The results from FetchXMLBuilder

 FetchBuilder.png

Notice for the last two that  regent_leadsource and regent_leadsourcedetails are missing as columns.

Any help would be greatly appreciated.

Thanks, and God bless,

Daniel Hines

Regent University

Christian Leadership to Change the World

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     not sure about FetchXmlBuilder, but, for the webAPI.. If you look at the same opportunity (1c983ded-6dff-e611-80cd-e0071bf2c07b) in the Advanced Find, will you see any value in the regent_leadsource column?

  • Verified answer
    Community Member Profile Picture
    on at

    It is by default, fields with empty value will not be shown in the result.

  • Community Member Profile Picture
    on at

    Thank you all, that was my issue.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans