Skip to main content

Notifications

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...

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: msdyncrm_FetchContactsByQuery - why both query and fetchxml?

    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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans