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

Can you unset field of type Option Set using CDS with a patch?

I have an entity that contains a field of type option set. This value is not required. I'm trying to 'unset' from my app by calling:

Patch( Elements, LookUp( Elements, Element=ElementId ), { 'option set field' : Blank() } )

However, when this patch command is called the data is not modified. 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Can you unset field of type Option Set using CDS with a patch?

Hi @MrNappa ,

 

Will the issue solve after you set the  Option Set field with existing value?

 

Regards,

Mona

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

Re: Can you unset field of type Option Set using CDS with a patch?

No. Take for example the following test I did:

 

Field definition:

 optionset.png

Test code:

optionsettest.png

When you select the 1 or 2 and click the 'Patch' button, the value updates to the selected value. But the 'unset' option does not work; it simply ignores the Blank() patch.

 

(btw, I know I can work around it by introducing an additional value to the option set that represents a 'not filled out'/'not set' option, but that feels redundant)

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,618)