cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
joef
Level 8

Compare a column in SPO list to a text box on a form

Hi All,

I have a dropdown control on my form pointing to a SPO list "Choices('Mail Room APP'.CompanyName)"

I have a bracode scanner where I am setting a Var "Set(VarBarcode, BarcodeScanner2.Value)"

I have a gallery set to: Filter('Mail Room APP', (MultiBarcode=VarBarcode)) to pull the data back from my list so I can update columns and submit them.

I need to make sure that the company name in my list for that barcode = the value selected in the dropdown, to make sure we are delivering the correct package to the correct company from the check-in of the package.

Is there a way to check if the company name in my list = the company name of my dropdown control.value?

I want to popup a message box (Html text box) to say the company in the list does not match the company in the dropdown...

 

I have been trying to get this to work using both Lookup and Filter, but neither likes my code 😞

 

If(LookUp('Mail Room APP', (MultiBarcode=VarBarcode)) in Dropdown2.SelectedText,UpdateContext({VarLookupBarCompany:true}),
Set(VarBarcode, BarcodeScanner2.Value))

 

I tried in, exactin, =, <> keeps complaining about invalid argument type 

 

TIA,

Joe

1 ACCEPTED SOLUTION

Accepted Solutions
joef
Level 8

Re: Compare a column in SPO list to a text box on a form

HI @GarethPrisk ,

I figured this out 🙂

I had to do a bit more than you said, but you got me thinking in the right direction 🙂

 

1) set the show textbox variable to false
UpdateContext({VarLookupBarCompany:false});

2) set the lookup barcode's variable, so the lookup has something to look up
Set(VarBarcode, BarcodeScanner2.Value);

3) Then do the lookup to set the show Variable or the Barcode Variable depending if the company is correct or not.
If(LookUp('Mail Room APP', (MultiBarcode = VarBarcode) , CompanyName.Value = Dropdown2.SelectedText.Value),Set(VarBarcode, BarcodeScanner2.Value),
UpdateContext({VarLookupBarCompany:true}),Set(VarBarcode, ""))

 

Thanks for getting me on the right track!!

Joe

View solution in original post

3 REPLIES 3
GarethPrisk
Level: Powered On

Re: Compare a column in SPO list to a text box on a form

Are MultiBarcode and VarBarcode the same field types? You showed them as a Gallery filter, so guessing that works.

For your LookUp function, you are currently returning the record based on the lookup. You need to add a reduction formula, to get the appropriate attribute to evaluate.

Such as If(LookUp('Mail Room APP', (MultiBarcode=VarBarcode), 'Company Name') in Dropdown2.SelectedText,UpdateContext({VarLookupBarCompany:true}),
Set(VarBarcode, BarcodeScanner2.Value))

 

joef
Level 8

Re: Compare a column in SPO list to a text box on a form

Hi @GarethPrisk,

Yes if I remove the if statement and only set the Var "OnScan", My gallery fills the data from the list = to the barcode.

 

I tried to add the CompanyName, but then I get lookup or filter has bad arguments, still fighting this, i am sure I will get the syntax down eventually :).

I will post it back here if/whne I get it.

 

Thanks,

Joe

 

joef
Level 8

Re: Compare a column in SPO list to a text box on a form

HI @GarethPrisk ,

I figured this out 🙂

I had to do a bit more than you said, but you got me thinking in the right direction 🙂

 

1) set the show textbox variable to false
UpdateContext({VarLookupBarCompany:false});

2) set the lookup barcode's variable, so the lookup has something to look up
Set(VarBarcode, BarcodeScanner2.Value);

3) Then do the lookup to set the show Variable or the Barcode Variable depending if the company is correct or not.
If(LookUp('Mail Room APP', (MultiBarcode = VarBarcode) , CompanyName.Value = Dropdown2.SelectedText.Value),Set(VarBarcode, BarcodeScanner2.Value),
UpdateContext({VarLookupBarCompany:true}),Set(VarBarcode, ""))

 

Thanks for getting me on the right track!!

Joe

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,241)