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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Web API, how can I expand listMembers lead or contact

(0) ShareShare
ReportReport
Posted on by 5

Hello,

I'm developing a web app that needs to retrieve leads or contacts from a static marketing list

Eg.

Fetch list members for a selected list

/webapiurl/listmembers?$filter=_listid_value eq d4034a9f-eadb-ea11-a813-000d3a22128b

This works as expected, and returns amongst other data, the entity type "lead" and "listmemberid" (which identifies the lead by it's 'leadid'. How can I include the Lead  and email address for example in a single query, keeping in mind that the list may contact thousands of leads.

I've tried various forms of expand, as below;

/webapiurl/listmembers?$filter=_listid_value eq d409ba9f-eadb-ea11-a813-000d3a22c28b$expand=listmemberid($select=leadid,fullname)

but get this message

"Property 'listmemberid' on type 'Microsoft.Dynamics.CRM.listmember' is not a navigation property or complex property. Only navigation properties can be expanded."
What field/column can I use to expand the lead, or is lead expansion not possible in this query?
Is there another way that I can achieve the same result using a single query ?
Any help would be appreciated.

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Dan,

    From my test,

    it seems that there is no single-valued navigation property called listmemberid by default to listmember entity, thus the second web api couldn't execute successfully.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/listmember?view=dynamics-ce-odata-9#single-valued-navigation-properties

    You could try to use listcontact_association or listlead_association property of list entity to get all members of a specific marketing list in a single web api query.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/list?view=dynamics-ce-odata-9#collection-valued-navigation-properties

    api/data/v9.1/lists(xxxx)?$expand=listcontact_association($select=fullname)

    3021.JPG

    Regards,

    Clofly

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I would recommend to try fetchXml approach and use following FetchXml query:

      
        
          
        
        
          
        
      
    

  • Suggested answer
    AnotherDan Profile Picture
    5 on at

    Thank you Clofly! You made my day and answered my question. Thank you for taking the time and effort to help me with this - i've been stuck on this for a while now and your solution is perfect!

  • AnotherDan Profile Picture
    5 on at

    Thanks Andrew.

    I've yet to try fetchXml - so I'll keep this in my toolbox for future use. Clofly's solution was perfect.

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 58 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 42

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans