cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rajmilansinh
Level: Powered On

How to update Dynamics 365 lookup value to null using Power Apps?

 Hi Community,

 

I have a requirement to update record with lookup field.

I am able to update lookup field with value which is selected.

 

But when we want to make it null again then it is causing issue.

 

I have to make lookup field again blank / null.

I have tried to update with "Blank()" but it is not worked for me.

 

It is not letting me to save the data.

Please help

 

Error Text: "An unknown error occured."

2 REPLIES 2
Community Support Team
Community Support Team

Re: How to update Dynamics 365 lookup value to null using Power Apps?

Hi @rajmilansinh ,

How do you patch the NULL value or Blank value to the LookUp field of your D365 Entity from your app?

Could you please share a bit more about the formula that you used?

 

It is a common issue within PowerApps, there is no direct way to patch a NULL value to a LookUp column in Dynamics 365 Entity. The user @Sanoj has shared an alternative solution for similar issue, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Update-blank-Null-value-to-fields-Date-User-C...

 

Please also check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rajmilansinh
Level: Powered On

Re: How to update Dynamics 365 lookup value to null using Power Apps?

Hi  @v-xida-msft 

 

Thanks for suggestion and information.

I have used that feature but its not working with it.

 

I am updating lookup field with Patch function:

 

Patch(
    'Entityname',
   recordguid,
    {
        'fieldName': Blank()                            
    }
);

But it gives error as I said.

 

I have done work around by creating another string field and updating that string field from powerapps and then Plugin will take value from that string field, finally plugin will update my lookup field. If its null then I store value as "null" in string field and if its not null then I store guid of that record in it. 

 

Then I update that lookup field based on that string field, if it is containing "null" as string then I update lookup as null or if it storing GUID then I update it with that GUID.

 

I will update the code and method if there is any better solution comes up in future.

 

Thank you,

Milansinh Raj

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,966)