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

$expand and $ref

(0) ShareShare
ReportReport
Posted on by 5

Hello,

I'm new at dynamics 365 API requested, being a dummies I have an issue when expanding a column.
I learn how to write, and it works:

"https://microsoftsales.api.crm.dynamics.com/api/data/v9.1/leads?$filter=Microsoft.Dynamics.CRM.OnOrAfter(PropertyName=@p1,PropertyValue=@p2)&@p1='createdon'&@p2='01/01/2019'&$expand=createdby($select=_siteid_value;$filter=_siteid_value eq xxxxxxxxx),&$select=_ownerid_value,
_createdby_value, estimatedamount_base, revenue_base, msp_cssdisposition, _campaignid_value, createdby, leadqualitycode, _accountid_value, numberofemployees,
_parentaccountid_value, msp_primaryproductcode, subject, msp_leadnumber, msp_estimatedquantity, msp_countrycode, numberofemployees, createdon"

However, it gives me all data, I only want the ones associated with the $filter=_siteid_value eq xxxxxx. I tried to use $ref but it didn't work.
Can someone help with this issue?

Many thanks in advance.

 

I have the same question (0)
  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Hi carolinabbruno . 

    Can you try to create the API you need using Jason Lattimer's CRM REST Builder tool?

    https://github.com/jlattimer/CRMRESTBuilder/releases 

    Here is a link on how to use the tool: https://carldesouza.com/dynamics-crm-rest-builder/

    The tool should make it easier to formulate the right API as well as test it out and see the results in real-time. 

    Regards, 

    Shidin

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 73 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 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