Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics 365 V9 - WebAPI: set lookup values through logic apps with webapi

(0) ShareShare
ReportReport
Posted on by 605

Hi

We are setting up a logic apps integration which has to set lookup attributes:

we do a patch to upsert a record based on an alternate key:

PATCH https://securexsandbox.crm4.dynamics.com/api/data/v9.0//accounts(xyz_sourcekey='@{triggerBody()?['Id']}')

in the body we specify the lookup value for the parent account attribute:

in body we have: "parentaccountid@odata.bind": "/accounts(xyz_sourcekey='@{triggerBody()?['ParentId']}')"

 

But, we are struggling with clearing the lookup values. We have read that in order to remove the lookup value, we have to execute a delete request on the relationship: https://community.dynamics.com/crm/f/117/t/204711

For our logic app which has to update 3 different lookup attributes, it means 2 extra actions per empty lookup:

  • check if the value is null
  • if it is null , then execute an extra delete request

Also we have to be able to make our json body dynamic with the http action, as we only wan to include the lookup attributes if they are not empty:

we have to skip this line for example:  "parentaccountid@odata.bind": "/accounts(xyz_sourcekey='@{triggerBody()?['ParentId']}')"

Do you have any other ideas on how we can solve this with a minimum of actions in LA and performance cost on Dynamics 365?

Does anyone know how to make that json body on the HTTP action in logic apps more dynamic?

Kind regards,

K

*This post is locked for comments

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans