cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate III
Advocate III

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
Community Support

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.

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,957)