How to clear lookup values on Updates using the new CDS connector.
If you're not already using the new CDS Flow connector I suggest you start looking at it as it has a lot more features than the prior version BUT is only available when you are creating Flows within a solution in the Power Platform. In addition, as per my previous post on setting lookup values ( https://www.msdynamicduo.com/home/setting-lookup-values-in-the-new-flow-cds-connector ) , there are a few changes around how you work with lookups during create and update actions.
In the older CDS connector you could clear a lookup simply by setting its value to null using the Expression language (as shown below). However if you try this in the new CDS connector it will fail.
All I was trying to do here is clear the Primary Contact reference I had previously added to the Account on creation in the previous step (purely to illustrate the issue).
In the new CDS connector you need to use the new "Dissociate entities" action in order to achieve this.
Note: this has recently been renamed so may now appear as "Unrelate records" but it is the same action under the covers as far as I'm aware.
This might seem slight counter-intuitive but the Entity Name should be the name of the entity reference you are trying to clear and the Item Id, the associated item id. You then choose the applicable entity relationship to disassociate, in this case, account_primary_contact and finally specify the Disassociated Item full URL identifier as shown below.
I found this last part a bit confusing as it says "Full URL path to resource" when in fact it only needs the unique id (GUID) of the Account from which you wish to disassociate the Primary Contact.
Newly renamed version shown below for reference purposes:
When I then create the Contact, the Account will originally get created with the Primary Contact as the created contact but then subsequently this will be cleared by the "disassociate" action.
Contact "John Halsey" created.
Account created with Primary Contact that is then cleared.