web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Barcode Scan Value to ...
Power Apps
Unanswered

Barcode Scan Value to another Data Card

(1) ShareShare
ReportReport
Posted on by 39

Hello Everyone, 

 

I very new to powerapps and hope this can be done very easily. 

 

I currently have a DataCardField called Vehicle VIN and item properties for this field is: 

Choices([@'Vehicle Mileage Report_1'].'Vehicle VIN')

 

This basically generates a drop-down field for users to enter from a selected list of VIN's.  I like this option but in addition, I would like to include the option for a user to scan the Vehicle VIN using their mobile device.  At this time, I incorporated the barcode scanner function but I would like for it to update the Vehicle VIN DataCardField with the scan results. Can this be done?

 

For BarcodeScanner1 onscan update datacardvalue with value without affecting the dropdown option.

 

Hope I'm explaining this correctly.

 

I would like this field to not only display 

Categories:
  • JLincoln Profile Picture
    69 on at

    Okay, so you want the value to be included in the dropdown and also be the default value.

    Pull the value out of the barcode scanner using BarcodeScanner1.Value. This should be your VIN number.

    The type of dropdown (Dropdown or Combo Box) you're using means this is going to be easy or a bit harder, but what you want is very possible, you'll just have to play around with how you name stuff until you get it right.

    One way to do this is using Ungroup(), but you HAVE to have the column names the same. As you can probably tell, 'Vehicle VIN' is not the same as 'Value', so you either have to rename the BarcodeScanner1.Value into another column or rename Vehicle VIN; the latter is easier.

    Another is to just collect the new VIN. This is... easier.

    Whenever you want to grab the vin numbers, use this.
    ClearCollect(
        colVINNumbers,
        RenameColumns(
            ShowColumns( [@'Vehicle Mileage Report_1'], "Vehicle VIN"),
            "Vehicle VIN",
            "Value"
        )
    );

    On the OnScan property of the barcode, put
    Collect(
        colVINNumbers,
        BarcodeScanner1.Value
    )

    Now, what if your VIN number is duplicate? that wouldn't be very nice, would it.
    For your choices, you're going to want distinct values, so your choices would be
    Choices(Distinct(colVINNumbers).Result)

    Now you want to set your default value (defaultselecteditems) to BarcodeScanner1.Value, but Result <> Value. That should be fine if you're using a dropdown, but if you're using a combobox then you'll have to manipulate BarcodeScanner1.Value into being a .Result form. You could go DefaultSelectedItems on the combo box to Distinct(BarcodeScanner1.Value).Result, and that's a bit hacky but it should work.

    Uh... pretty sure that's all you need! If you have any more questions feel free to reply 😃

  • masterp Profile Picture
    39 on at

    @JLincoln 

     

    This sounds good but it's not what I am looking for and I probably didn't explain correctly.  Hope this helps explain my goal. 🙂

    2020-10-12_13-14-49.png

    VehicleVINDrop Down.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard