Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

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

$
0
0

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


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>