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

Duplicate check in Collection

Hello all,

 

I'm trying to make a barcode input check for duplicates before writing to a collection with the following formula:

 

If(
    BarcodeScanner1_1.Text exactin ConsigmentTable.Serial_Number,
    UpdateContext({MessageBoard: "Duplicate Serial, please check"}),
    Collect(
        ConsigmentTable,
        {
            Serial_Number: BarcodeScanner1_1.Value,
            Checkedby: User().FullName,
            Scan_Date: Today(),
            Quantity: 1
        }
    )
)

 

However it seems to always go straight to the FALSE part of the statement. 

Also did try with:

 

If(LookUp(ConsigmentTable, BarcodeScanner1_1.Text in Serial_Number, "OK") <> "OK", ...

But alas, same thing. If anyone has a suggestion, I'll greatly appreciate the input!


I did try the suggestion listed here:
 https://powerusers.microsoft.com/t5/General-Discussion/Prevent-duplicate-values-in-a-collection-data...

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Duplicate check in Collection

Hi @LordsBH ,

 

In your Lookup formula, may I ask what is this "OK" referring to? Is it one of the column's column name of ConsigmentTable?

 

Try to use below formula instead:

 

If(!IsBlank(LookUp(ConsigmentTable, BarcodeScanner1_1.Text=Serial_Number)) , ...

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Duplicate check in Collection

Hi @LordsBH ,

 

In your Lookup formula, may I ask what is this "OK" referring to? Is it one of the column's column name of ConsigmentTable?

 

Try to use below formula instead:

 

If(!IsBlank(LookUp(ConsigmentTable, BarcodeScanner1_1.Text=Serial_Number)) , ...

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Duplicate check in Collection

It worked like a charm, @v-monli-msft, thanks!

 

I had to change the BarcodeScanner1_1.Text to BarcodeScanner1_1.Value, but it did work Smiley Happy

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,912)