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

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

(5) ShareShare
ReportReport
Posted on by 30
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#?
 
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,758 Most Valuable Professional on at
    • 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
    30 on at
    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,758 Most Valuable Professional on at

    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.
  • Guy Boswell Profile Picture
    65 on at

    Of course, Outbound Segments are gone!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Syed Aqib Raza Profile Picture

Syed Aqib Raza 103

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 83 Most Valuable Professional

#3
11manish Profile Picture

11manish 54 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans