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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

msdyncrm_FetchContactsByQuery - why both query and fetchxml?

(0) ShareShare
ReportReport
Posted on by 2

Hi fellow community people, I am struggling with getting to grips with the msdyncrm_FetchContactsByQuery to access segments in Dynamics Marketing. The documentation says this is the way to fetch all members of a segment:

POST {{OrgUrl}}/api/data/v9.0/msdyncrm_FetchContactsByQuery
{
    "Query":"(SEGMENT(SEGMENT_CRM_ID_e1fa7fdc5c78ea11a811000d3a8e8fcc)).ORDERBY(fullname ASC).SKIP(0).TAKE(1000).SELECT(contactid)",
    "FetchXml":"","OwningBusinessUnit":"0b4b85cc-7f6c-ea11-a811-000d3a54d359",
    "Scope":270100000,
    "TimeZone":null
}

Isn't this using two different methods for the same thing? Both Query and also FetchXML. When testing, it seems like the Query is actually capable of returning large datasets (over 100 000 contacts), by increasing the "TAKE"-variable. However, it seem slike the fetchxml limits the actual datafields returned. So in this example, it returns 1000 contacts, but only the first 15 includse all fields as described in the fetchxml. Trying to increase the fetchxml count to 100 000 only results in http timeouts.

Can anyone shed som light on why both query and fetchxml is needed?

Also, anyone know of resources documenting this a little bit more? https://docs.microsoft.com/en-us/dynamics365/marketing/developer/segment-query-definition

For example, what does the skipFunction do? I guess it skips something...

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,060 on at

    Hi,

    Here is an example which you can refer to:

    FetchXml to retrieve segment member - Dynamics 365 Marketing Forum Community Forum

    And about the skipFunction, there is currently no detailed description can be found in the official documentation.

    It is recommended to raise a support ticket for further help.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 202 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 70

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans