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

Inserting Null/Blank value into ComboBox controls to Update SharePoint list

Power Apps newbie here. Hoping I can find some help.

 

I have a form, "SurveyForm" with multiple ComboBox controls.

 

The form is connected to a SharePoint list data source. The SharePoint columns are Choice columns.

 

Using the Patch function, I am able to insert ComboBox values into the SharePoint list fields.

 

My problem is when I need blank or null value to be inserted into the SharePoint list fields.

 

For instance, I select a value of "5" in the ComboBox form control.

 

I click the "Submit" button and the associated SharePoint list field is updated with the selected value "5". That's good! Very proud of me.

 

But, if I go back to the ComboBox and delete the "5," leaving the selection blank, the SharePoint list field still holds the original value "5" after I click the "Submit" button.

 

I need the field in SharePoint to be blank.

 

If I could get some insight or be pointed in the right direction to figure this out, I would be extremely grateful.

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SatxThree
Frequent Visitor

OK. So the fix is to enable "Formula-level Error Management."

 

Go to "Settings" > "Upcoming features" > "Experimental" > Toggle on "Formula-level Error Management"

 

View solution in original post

5 REPLIES 5
SatxThree
Frequent Visitor

OK. So the fix is to enable "Formula-level Error Management."

 

Go to "Settings" > "Upcoming features" > "Experimental" > Toggle on "Formula-level Error Management"

 

indhaa
Super User
Super User
SatxThree
Frequent Visitor

Hi indhaa,

 

Many thanks for the reply, but I found the solution.

JR-BejeweledOne
Super User
Super User

You will need to do an if or switch when you patch that value.    In your patch statement you can do something like this.    For each column in your list that needs to have a blank value if the combobox is blank, set the patch for that specific column like this.

 

 

Patch(DataSource, xxxxx,

{
  ColumnName:
   If ( IsBlank(ComboBoxX.SelectedItems),  Blank(),
    ComboBoxX.Selected.Value
  Column2Name:
   If ( IsBlank(ComboBoxY.SelectedItems),  Blank(),
    ComboBoxY.Selected.Value
)

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Hi JR-BejeweledOne,

 

I was hoping for a solution that didn't require adjusting individual columns because there are quite a few. (70+)

 

I think toggling "Formula-level Error Management" in the settings did the trick in my situation.

 

But actually, I did learn something from your reply. One of the solutions I tried was similar to your suggestion:

If ( IsBlank(ComboBoxY.SelectedItems)

But I left out this part and it wasn't working:

Blank()

Now I know for future reference. 

 

Many thanks for taking the time to reply. I greatly appreciate it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,678)