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

Community site session details

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

How to retrieve segment members from advance find or in C#

(5) ShareShare
ReportReport
Posted on by 26
Hi,
I am trying to retrieve segment members from advanced find but my segments are not showing. When I look at the fetch xml, query looks like below. But, segments are stored in msdynmkt_virtualsegmentid and fetch xml points to msdyncrm_segment
 
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="contact">
<attribute name="fullname"/>
<attribute name="telephone1"/>
<attribute name="contactid"/>
<order attribute="fullname" descending="false"/>
<link-entity name="msdyncrm_segment" from="msdyncrm_segmentid" to="msdyncrm_segmentmemberid" link-type="inner" alias="ac">
<filter type="and">
<condition attribute="msdyncrm_segmentid" operator="eq"/>
</filter>
</link-entity>
</entity>
</fetch>
 
 
Is there a way to retrieve segment members in fetch xml or c#?
 
I have the same question (0)
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,336 Most Valuable Professional on at
    How to retrieve segment members from advance find or in C#
    • Use Outbound segments if you need static membership lists and fetch support.
    • For testing, use the "Check segment members" option within the segment designer in Real-time Marketing UI.
    • If needed programmatically, build a custom logic in C# to evaluate the segment criteria manually on Contact data.

    Note: You cannot retrieve Real-time Marketing segment members via FetchXML or C# directly because they are virtual. Consider using Outbound segments or custom evaluation logic based on segment rules.
     
  • CU06020341-0 Profile Picture
    26 on at
    How to retrieve segment members from advance find or in C#
    Hi Muhammad,
    Thanks for the reply. We have a requirement to get segment from journey and get segment members and send response to extrename system. As per docmentation https://learn.microsoft.com/en-us/dynamics365/customer-insights/journeys/real-time-marketing-api-segment  we can use POST: <Organizaiton URL>/api/data/v9.0/msdynmkt_MembersList.  But it seems not stightforward. 
  • Muhammad Shahzad Shafique Profile Picture
    2,336 Most Valuable Professional on at
    How to retrieve segment members from advance find or in C#

    Microsoft API (Preview): msdynmkt_MembersList

    Endpoint:

    POST /api/data/v9.0/msdynmkt_MembersList
    
    Usage:
    You can pass a segment definition and get members via backend evaluation. This API only works for real-time marketing segments, and requires:
    • segmentdefinitionid (from msdynmkt_segmentdefinition)
    • A refreshmembers flag

    Example:
    POST https://<org>.crm.dynamics.com/api/data/v9.0/msdynmkt_MembersList
    
    {
      "msdynmkt_segmentdefinitionid": "<GUID>",
      "msdynmkt_refreshmembers": true
    }
    

    This triggers evaluation of the segment and returns a GUID to a generated list of members. However, this is not instant — you may have to poll for the result.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 117 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 115

#3
Erin Lubben Profile Picture

Erin Lubben 66

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans