# Using UPC Code to Link to another Collection

**URL:** <https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309>\
**Category:** Database\
**Created:** [September 29, 2023, 2:53pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309 "2023-09-29T14:53:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidmmiami](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@davidmmiami](https://forum.adalo.com/u/davidmmiami)\
**Post date:** [September 29, 2023, 2:53pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/1 "2023-09-29T14:53:35Z")

</div>

Hello,

I’m creating an app for a regional retailer to keep track of the inventory. I have 3 collections: stores, products, and inventory, which has relationships to both stores and products (AKA SKUs). I added a QR code scanner so that the store employee can scan the barcode of a product, and it will create a record in inventory that links that record to the SKU with the matching UPC code to that scan. Currently. I have the “Name” field being created with the scan data (because that’s the only field that it was allowing me to put this). I want to have some sort of operation that uses the Name to lookup in the SKU collection to determine which SKU to connect to this inventory record. Anyone know how I can do that?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/9/d/9d8111fe2f709b2bf911ea4a6162644769bd1339.png)

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [September 29, 2023, 4:00pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/2 "2023-09-29T16:00:32Z")

</div>

The user scanning the item should be on a screen than has ‘Current store’ as Available data. Or if the user can only work at one store, then have a relationship in the user _Assigned\_Store_.

Current store will only be available if it comes from a list on the previous screen.

Assigned Store will be available on all screens because it comes from Logged In User.  
Once you have either of these in place you will be able to add that product then update via separate action to be part of the current inventory.

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/d/d/dda5f30b4b2035a3ccdc7ffdaaa597c1645015f4.png)

[![](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/0/6/068a8e28ff4604b9c8c9264fb75be5b066dff777.jpeg "Working with Data in a No Code App") ](https://www.youtube.com/watch?v=dWJWNXn3RPc)

---

<div class="post-metadata">

**Author:** ![davidmmiami](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@davidmmiami](https://forum.adalo.com/u/davidmmiami)\
**Post date:** [September 29, 2023, 7:16pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/3 "2023-09-29T19:16:16Z")

</div>

Thank you for your response; I’m still kind of confused. I’m fine with assigning the correct store to the record, that all seems to be working. What isn’t working is using the scanned UPC code from the barcode scanner to create a link to the corresponding record in the Products database. Can you help me out with that?

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [September 29, 2023, 8:29pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/4 "2023-09-29T20:29:19Z")

</div>

I’ll try to. What’s the component being used to scan the barcodes?

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [September 30, 2023, 7:48am UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/5 "2023-09-30T07:48:13Z")

</div>

The QR scanner?

After the scan it could update a text input **Input UPC**  
This then filters a list of products based on the UPC (QR Data).  
From that list you then add it to the inventory.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/9/1/914f27dada93215eddf6e84fe30de7a5359c1528.png)

---

<div class="post-metadata">

**Author:** ![davidmmiami](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@davidmmiami](https://forum.adalo.com/u/davidmmiami)\
**Post date:** [October 4, 2023, 2:38pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/6 "2023-10-04T14:38:19Z")

</div>

This makes a lot of sense, thank you. The one thing I can’t figure out is how to reference the input value when filtering the list? I’m not seeing any option come up that allows me to reference the input value

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [October 4, 2023, 2:52pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/7 "2023-10-04T14:52:09Z")

</div>

This should help

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/d/5/d53459bee2af857a4e5366badd759fc3f17026dd.png)

You may be able to directly reference the QR Scanner. Try it.

---

<div class="post-metadata">

**Author:** ![davidmmiami](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@davidmmiami](https://forum.adalo.com/u/davidmmiami)\
**Post date:** [October 4, 2023, 3:52pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/8 "2023-10-04T15:52:47Z")

</div>

This isn’t showing up under other components. Any idea why?

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [October 4, 2023, 4:06pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/9 "2023-10-04T16:06:26Z")

</div>

Probably because you haven’t got another component on your screen. Put an input box on there 👍

---

<div class="post-metadata">

**Author:** ![davidmmiami](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@davidmmiami](https://forum.adalo.com/u/davidmmiami)\
**Post date:** [October 4, 2023, 4:25pm UTC](https://forum.adalo.com/t/using-upc-code-to-link-to-another-collection/42309/10 "2023-10-04T16:25:40Z")

</div>

Perfect thank you so much! You’re so helpful. Final question: what button action would I put to add entries from the list as records in the inventory collection?
