cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MiteshGovan
Helper V
Helper V

Combox search and add item

Hi

 

I have a combo box search where an item is added every time you add a new item. 

 

How do you prevent blanks from being captured?

How do you prevent an item from reposting again? I don't want any duplicated item. I want to be notified that the item is already available on the system.

 

I have posted the image and formula below.

 

MiteshGovan_0-1619086723126.png

Set(var,ComboBox2.SearchText);
If(IsEmpty(Filter('CP Drugs and Dosage',Title=var)),Patch('CP Drugs and Dosage',Defaults('CP Drugs and Dosage'),{Title:var}))

2 ACCEPTED SOLUTIONS

Accepted Solutions
iAm_ManCat
Super User II
Super User II

Hi,

 

I was thinking you would check the blank state of the actual value, like:

If(
   IsBlank(LookUp('CP Drugs and Dosage',Title=var).Title),
   Patch('CP Drugs and Dosage',
         Defaults('CP Drugs and Dosage'),
         {Title:var}
   )
)

 

Could you try that and let me know if that's any better?

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Ohhh, I've just realised that we aren't checking for when searchtext is blank so every blank is being added 😸

 

If(
   IsBlank(LookUp('CP Drugs and Dosage',Title=var).Title)
   &&
   !IsBlank(var),
   Patch('CP Drugs and Dosage',
         Defaults('CP Drugs and Dosage'),
         {Title:var}
   )
)
@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

3 REPLIES 3
iAm_ManCat
Super User II
Super User II

Hi,

 

I was thinking you would check the blank state of the actual value, like:

If(
   IsBlank(LookUp('CP Drugs and Dosage',Title=var).Title),
   Patch('CP Drugs and Dosage',
         Defaults('CP Drugs and Dosage'),
         {Title:var}
   )
)

 

Could you try that and let me know if that's any better?

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Hi @iAm_ManCat 

 

I have tried the formula and I'm still generating blanks on a combobox. 

MiteshGovan_0-1619111095192.png

 




Ohhh, I've just realised that we aren't checking for when searchtext is blank so every blank is being added 😸

 

If(
   IsBlank(LookUp('CP Drugs and Dosage',Title=var).Title)
   &&
   !IsBlank(var),
   Patch('CP Drugs and Dosage',
         Defaults('CP Drugs and Dosage'),
         {Title:var}
   )
)
@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

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 (73,363)