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

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

(0) ShareShare
ReportReport
Posted on by 607

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

I have the same question (0)

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

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans