Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to send OData EntityReference (Lookup) values from Json

(0) ShareShare
ReportReport
Posted on by

Hello,

I'm implementing a code within a Logic App to send data to a custom Activity in Dynamics online v8.2 web services. Everything looks like works good, all the data is making it to the custom activity and executes a plugin, but the issue is that all the EntityReferences are null at the time that reading the values.

This is the Dynamics activity field definition:

6327.Capture2.JPG

this is the Logic App.

3122.Capture1.JPG

in the ODataV4Metadata from CRM the needed field is defined this way:

<Parameter Name="leadId" Type="mscrm.lead"/>

and the way I'm sending the values from Postman to the Logic app is a simple Json field with the GUID on it:

{

"crmLeadId": "74ec5085-XXXX-e811-812e-e0071b6aaXXX",

}

does anyone knows how to define these type of values from the Json or something that could give a light?

Thank you!

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Hi Andrew...

    that worked! you rock!

    look, using it that way worked but needed to use the field name with the Id name just like it is in the CRM Entity, in this case "leadid".

    Thank you!

    0825.Capture7.JPG

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Try following for leadId:

    leadId: {

    leadid: "74ec5085-fd73-e811-812e-e0071b6aa291",

    "@odata.type": "Microsoft.Dynamics.CRM.lead"

    }

  • Community Member Profile Picture
    on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Hi Andrew,

    yes I did it and still showing the same error:

    "message": "An OData property annotation was found for a parameter payload; however, parameter payloads do not support OData property annotations.". 

    This is the complete Json message that I'm using, the GUID values are EntityReference fields, anyway, I'm evaluating the way to make the value visible in CRM with the plugin exception trace.

    {
    "address1City": "",
    "address1Line1": "123 Main",
    "address1Line2": "",
    "address1PostalCode": "",
    "address1StateOrProvince": "",
    "billingAddressSameasInstall": true,
    "campaignId": "FC3F7A95-D864-E811-8138-E0071B6AD111",
    "desiredCallTime": "2018-06-19T16:35:05Z",
    "email": "",
    "firstName": "Jairo",
    "futureInstallReason": "",
    "installAddressCountry": "",
    "installJobNumber": "",
    "installStreetName": "",
    "installStreetNumber": "",
    "installUnitNumber": "",
    "installationFeeId": "",
    "isFirstParty": true,
    "jornayaCampaignId": "E55426E4-6570-E611-80DC-FC15B4286CB8",
    "lastName": "VR_LA0618_01",
    "leadId@odata.bind": "/leads(74ec5085-fd73-e811-812e-e0071b6aa291)",
    "leadIdData_result": 0,
    "leadIdLabsData_result": 0,
    "leadQualifierData_age": "20",
    "leadQualifierData_ageRule": false,
    "leadQualifierData_authentic": false,
    "leadQualifierData_capture": false,
    "leadQualifierData_captureRule": false,
    "leadQualifierData_dataIntegrity": 0,
    "leadQualifierData_dataIntegrityFailed": "[\"JAIRO\",\"VR_LA0618_01\",\"1020180618\"]",
    "leadQualifierData_dataIntegrityPassed": "[]",
    "leadQualifierData_dataIntegrityRule": false,
    "leadQualifierData_deviceDay": 0,
    "leadQualifierData_deviceDayRule": false,
    "leadQualifierData_deviceFiveMinutes": 0,
    "leadQualifierData_deviceFiveMinutesRule": false,
    "leadQualifierData_deviceHour": 0,
    "leadQualifierData_deviceHourRule": false,
    "leadQualifierData_deviceTwelveHours": 0,
    "leadQualifierData_deviceTwelveHoursRule": false,
    "leadQualifierData_deviceWeek": 0,
    "leadQualifierData_deviceWeekRule": false,
    "leadQualifierData_duration": "07",
    "leadQualifierData_durationRule": false,
    "leadQualifierData_entityRule": false,
    "leadQualifierData_entityValue": false,
    "leadQualifierData_ipDay": 0,
    "leadQualifierData_ipDayRule": false,
    "leadQualifierData_ipFiveMinutes": 0,
    "leadQualifierData_ipFiveMinutesRule": false,
    "leadQualifierData_ipHour": 0,
    "leadQualifierData_ipHourRule": false,
    "leadQualifierData_ipTwelveHours": 0,
    "leadQualifierData_ipTwelveHoursRule": false,
    "leadQualifierData_ipWeek": 0,
    "leadQualifierData_ipWeekRule": false,
    "leadQualifierData_leadAge": "07",
    "leadQualifierData_leadDay": 0,
    "leadQualifierData_leadDayRule": false,
    "leadQualifierData_leadDupe": false,
    "leadQualifierData_leadDupeCheck": "00",
    "leadQualifierData_leadDupeCheckRule": false,
    "leadQualifierData_leadDupeRule": false,
    "leadQualifierData_leadDupeTime": "0",
    "leadQualifierData_leadDuration": 0,
    "leadQualifierData_leadFiveMinutes": 0,
    "leadQualifierData_leadFiveMinutesRule": false,
    "leadQualifierData_leadHour": 0,
    "leadQualifierData_leadHourRule": false,
    "leadQualifierData_leadPlusDay": 0,
    "leadQualifierData_leadPlusDayRule": false,
    "leadQualifierData_leadPlusFiveMinutes": 0,
    "leadQualifierData_leadPlusFiveMinutesRule": false,
    "leadQualifierData_leadPlusHour": 0,
    "leadQualifierData_leadPlusHourRule": false,
    "leadQualifierData_leadPlusTimeFirstNotAvailable": 0,
    "leadQualifierData_leadPlusTimeFirstNotAvailableRule": false,
    "leadQualifierData_leadPlusTimeLastNotAvailable": 0,
    "leadQualifierData_leadPlusTimeLastNotAvailableRule": false,
    "leadQualifierData_leadPlusTwelveHours": 0,
    "leadQualifierData_leadPlusTwelveHoursRule": false,
    "leadQualifierData_leadPlusWeek": 0,
    "leadQualifierData_leadPlusWeekRule": false,
    "leadQualifierData_leadTwelveHours": 0,
    "leadQualifierData_leadTwelveHoursRule": false,
    "leadQualifierData_leadWeek": 0,
    "leadQualifierData_leadWeekRule": false,
    "leadQualifierData_regRule": false,
    "leadQualifierData_result": 1,
    "leadQualifierData_stored": false,
    "leadQualifierData_storedRule": false,
    "leadQualifierData_token": "45952EDD-B6D7-6278-6A5D-FBBD9ED2DB14",
    "leadQualifierData_totalEntities": 0,
    "leadQualifierData_totalEntitiesRule": false,
    "leadQualifierData_totalHops": 0,
    "leadQualifierData_totalHopsRule": false,
    "leadQualifierData_urlRule": false,
    "leadQualifierData_urlValue": false,
    "leadQualifierId": "45952EDD-B6D7-6278-6A5D-FBBD9ED2DB14",
    "primaryPhone": "1020180618",
    "providerName": "AC",
    "renterOwner": "N",
    "secondaryPhone": "",
    "spanishSpeaking": "No",
    "transactionCurrencyId": "7F4CA223-B47B-E511-80DD-3863BB2E6B80"
    }

    This is the plugin Trace.

    1781.Capture6.JPG

    These are the complete list of headers I'm using with Postman

    1781.Capture6.JPG

    Thanks!

  • Community Member Profile Picture
    on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Hi Nodal,

    Thanks for your reply, when I used the header "Prefer":"odata.include-annotations="*", the result is the same.

    Thank you!

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Replace

    "crmLeadId@odata.bind": "/leads(74ec5085-XXXX-e811-812e-e0071b6aaXXX)"

    with input name as you have it in CRM

    "leadId@odata.bind": "/leads(74ec5085-XXXX-e811-812e-e0071b6aaXXX)"

    and provide the rest of arguments please.

  • NODAL Profile Picture
    860 on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Hi jairo,

    Add "Prefer" header for your xhr(xml http request) to get formatted values.

    Regards,

    NODAL

  • Community Member Profile Picture
    on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Sure, here it is, BTW I'm using the field value in a custom plugin.

    3583.Capture4.JPG

    Thank you!

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to send OData EntityReference (Lookup) values from Json

    I believe you call action. Can you please provide screenshot of that action?

  • Community Member Profile Picture
    on at
    RE: How to send OData EntityReference (Lookup) values from Json

    sure, here it is:

    7484.Capture3.JPG

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to send OData EntityReference (Lookup) values from Json

    Can you please post screenshot from postman? If it works in postman it should work the same way with LogicApp.

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 > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans