cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MJ84
Helper I
Helper I

Patch based on a blank value in a combobox

I have a combobox where I want it to patch the selection into a SP list if there is a selection made. If a selection is removed (clicking the X on the selected result I want it to patch back to the SP "Available"...

 

I  have the following line of code on the onchange property of the combobox. The problem is it only patches "Available" never the selection... I think from watching it, it runs through the code Patches the selection from the combobox then it carries on and then just patches back to "available"

 

Patch('SPList',ThisItem,{Spare1:If(IsBlank(ComboBox2_1.Selected.Result),"Available",ComboBox2_1.Selected.Result)})

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
poweractivate
Super User
Super User

@MJ84 

 

Don't use IsBlank here use IsEmpty. Like this Example:

 

 

If(!IsEmpty(ComboBox1.SelectedItems),Collect(MyColl02,"Some" & Text(RandBetween(10,100))),Collect(MyColl02,"Zome" & Text(RandBetween(1,100))))

 

 

Here notice it works see this example where it works and knows when there's nothing or something in Combobox and reacts differently with above formula:

102121-somezome.gif

 

 

 

 

View solution in original post

1 REPLY 1
poweractivate
Super User
Super User

@MJ84 

 

Don't use IsBlank here use IsEmpty. Like this Example:

 

 

If(!IsEmpty(ComboBox1.SelectedItems),Collect(MyColl02,"Some" & Text(RandBetween(10,100))),Collect(MyColl02,"Zome" & Text(RandBetween(1,100))))

 

 

Here notice it works see this example where it works and knows when there's nothing or something in Combobox and reacts differently with above formula:

102121-somezome.gif

 

 

 

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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