cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hemasai1999
Helper III
Helper III

Patch in Combobox

HI,

I have one Combobox in my app,

user should select from Combobox only then patch button should get enable, if user type something in search field then patch button should not get enabled.

when user is typing text in search box and not selecting , blank is getting updated into sharepoint list

 

Any suggestion would be helpful

Thanks in Advance

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @Hemasai1999 ,

For your first question, you can set below formula to the DisplayMode property of your patch button:

If(IsBlank(ComboBox.Selected.Value),Disabled,DisplayMode.Edit)

For your second question, when user types something and does not select any value from the combo box, your patch button will be disabled this time so you can click this patch button. Then how do you update into your SP list? Using another button? Maybe you need to add two buttons, the first one is used for updating selected value, the other one is used for updating blank value.

Best regards,

Allen

View solution in original post

2 REPLIES 2
v-albai-msft
Community Support
Community Support

Hi @Hemasai1999 ,

For your first question, you can set below formula to the DisplayMode property of your patch button:

If(IsBlank(ComboBox.Selected.Value),Disabled,DisplayMode.Edit)

For your second question, when user types something and does not select any value from the combo box, your patch button will be disabled this time so you can click this patch button. Then how do you update into your SP list? Using another button? Maybe you need to add two buttons, the first one is used for updating selected value, the other one is used for updating blank value.

Best regards,

Allen

View solution in original post

RusselThomas
Microsoft
Microsoft

Hi @Hemasai1999 ,

To add to @v-albai-msft 's response above - to be able to patch blanks to a source, you first need to ensure an advanced setting in your PowerApp is enabled, as per this blog post.  Go to your app "settings" > "upcoming features" > "experimental" and ensure "Formula-level error Management" is set to "On".  Note that this is set per app.  Without the above setting, trying to patch a Blank() back to SPO will do nothing.

Then, in your patch statement, you should be able to reference

Patch(mySource, myRecord, {comboField: ComboBox.Selected.Value})

 directly for that field value - if the combo has a value, it will patch that value - if it has nothing selected, it will patch a null value back to SPO, overwriting the previous value.

Hope this helps,

RT

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,315)