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.

 

  • Suggested answer
    Shidin Haridas Profile Picture
    3,497 on at
    RE: $expand and $ref

    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 99

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans