cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rajmilansinh
Level 8

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 8

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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