cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hasini
Helper II
Helper II

Update combobox value with null

Hello all,

 

I am using combo box in the form

i created record by selecting one value from the lookup (combobox)

And when i try to modify the same record , i am clearing the selected item in the combo box -> save the record

 

Value is not set to null instead ,it holds the previously selected value.

 

Kindly help me to achieve this

1 ACCEPTED SOLUTION

Accepted Solutions
PaulD1
Super User
Super User

What datasource are you using?

There is a (very long) standing bug that you cannot overwrite a populated value with a Null in SQL and internal collections when using a Patch statement (not sure about when working with Forms, I don't use them personally), although UpdateIf will work.

You may want to use 'unbound' controls rather than a form and an UpdateIf if you need to overwrite a populated field with a Null value.

View solution in original post

5 REPLIES 5
PaulD1
Super User
Super User

What datasource are you using?

There is a (very long) standing bug that you cannot overwrite a populated value with a Null in SQL and internal collections when using a Patch statement (not sure about when working with Forms, I don't use them personally), although UpdateIf will work.

You may want to use 'unbound' controls rather than a form and an UpdateIf if you need to overwrite a populated field with a Null value.

View solution in original post

Hi  @PaulD1 

 

I am using Dynamics 365FinanceAndOperation's entity as datasource

 

Sorry, not familiar with F&O but suggest you try testing using UpdateIf to see if that allows a Null value to be written over the top of a value in an existing record.

PowerApps has real trouble with Null values. The preview option 'Formula level error handling' is meant to fix some Null issues but introduces other problems/bugs (like not reliably being able to check if combobox is populated).

WarrenBelz
Super User III
Super User III

Hi @Hasini ,

Try going into File > Settings > Advanced Settings  > Formula Level Error Management (at the bottom) and turn it on.

If this does not work for you, try the following (use your names) -  - note the xxxx will need to reflect the value in your combo box.

If(
    Len(YourCOmboBoxName.Selected.xxxx)=0,     //change xxxx to suit
    ({
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        ID: 1,
        Value: ""
    }),
    YourComboBoxName.Selected
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @PaulD1 

 

Thank you

 

I can achieve using UpdateIf 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (54,184)