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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

The recommended way of retrieving segment members - with both a query and a fetchxml - which does what?

(0) ShareShare
ReportReport
Posted on by 2

Hi fellow community,

I wonder if any of you can shed som light on this. Accordgin to Basic operations on segments using API (Dynamics 365 Marketing Developer Guide) | Microsoft Docs this is the recommended way of retrieveing segment members:

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

I'm having a hard time understanding why there is both a query and a FetchXML. It's seems like there's no limit to the number of result record from the query, while the fetch do have limitations. I tried the following:

Query:

(SEGMENT
	(SEGMENT_CRM_ID
	)
).ORDERBY(mobilephone ASC).SKIP(5000).TAKE(1000).SELECT(contactid)

FetchXML:




My idea is that the query will fetch records from 5001 and to 6000, while the only thing the fetch does is to retrieve only the mobilephone attribute. Is this correct? If I then call this with a query saying SKIP(6000).TAKE(1000) - will it retrieve the next 1000?

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

    Hi,

    The maximum number of the contacts which are retrieved with a query is 5000.

    And yes, your idea is correct.

  • Olasan Profile Picture
    2 on at

    For the record - got this from support:

    Regarding your request of query and fetchxml part in retrieving segment members,

    - query is used to specify what contacts to be retrieved

    - And fetchxml is used to specify what fields for each contact you want to retrieve.

    Query is for contacts retrieval and fetchxml is for fields retrieval of a contact.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans