cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
moritz0815
Frequent Visitor

Clear ComboBox and save empty value

Hello dear community,

I have several ComboBoxes in my form that affect each other.
ComboBox1 has the choices "Yes" and "No".
When ComboBox1 is set from "Yes" to "No", all other ComboBoxes should be reset to blank.
When the form is submitted now, blank/null should also be entered in the SharePoint list. If there was an entry, it should be overwritten with blank/null.

My previous approach was that on the Combobox1 OnChange, a variable (DoReset) is set to true when the change from "Yes" to "No" is completed.

The DefaultSelectedItems formula is then adjusted like this: 

If(OnReset;myType;Parent.Default)

myType is defined like this: 

Set(myType; {Value: Blank()});;

How do I now manage to overwrite existing values with blank/null on submit?

 

11 REPLIES 11
moritz0815
Frequent Visitor

Sorry, the language is German.
It is a Choices column.

SharePoint-Screenshot:

moritz0815_0-1658547921455.png

"Auswahl" is the German word for "choice".

Hi @moritz0815 ,

That is really strange (also Id is normally associated with a Lookup column) as I have never had any difficulties clearing Choice columns when I use them. However I recall back in the rather deep past seeing that code being used, but a Choice field does not have an Id. I also answered this post a few months back with the same issue and it worked there. However if it works for you, it can be improved a bit to

If(
   OnReset;
   {
       Id: -1;
       Value: Blank()
   };
   {Value: DataCardValue20.Selected.Value}
}

 

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.

Visit my blog Practical Power Apps

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,004)