# Barcode

**URL:** <https://community.fliplet.com/t/barcode/808>\
**Category:** Get Help\
**Created:** [May 12, 2025, 5:42pm UTC](https://community.fliplet.com/t/barcode/808 "2025-05-12T17:42:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dev](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Dev](https://community.fliplet.com/u/Dev)\
**Post date:** [May 12, 2025, 5:42pm UTC](https://community.fliplet.com/t/barcode/808/1 "2025-05-12T17:42:25Z")

</div>

Hi  
I have the below code using the barcode component. The image is scanned but no result is returned. Anything I am doing wrong?  
Fliplet.Barcode.scan()  
.then(function (result) {  
// Add custom code here to use the result from the scan  
var textField = document.getElementById(‘29981888’); // Replace ‘your-text-field-id’ with the actual ID of your text field  
textField.value = result.text;

```
// result.format - tells you what format the code is
// result.cancelled - true if user cancels the scan

```

})  
.catch(function (error) {  
// Scan failed  
var textField = document.getElementById(‘29981888’); // Replace ‘your-text-field-id’ with the actual ID of your text field  
textField.value = ‘Fail’;  
});

This is the html field

---

<div class="post-metadata">

**Author:** ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)\
**Post date:** [May 19, 2025, 4:16pm UTC](https://community.fliplet.com/t/barcode/808/2 "2025-05-19T16:16:07Z")

</div>

Hi Dhavaraj,

Have you added the fliplet-barcode library to your screen resources? See here: [Scan a barcode or QR code - Fliplet Knowledge Center](https://help.fliplet.com/scan-a-barcode-or-qr-code/)

Thanks,  
Deb
