Automatically populate data by scanning barcode
Requirement
Scan a barcode to fetch the required details stored in another app.
Use Case
A mobile store uses an order management application to manage their orders. When a product is added to the form, a corresponding barcode is automatically generated and uploaded along with the product details.
The store uses another application for mobile phone servicing to scan the same barcode sticker on the mobile phone for quick retrieval of the product details.
Steps to follow
1. Lets us first build an order management application.
Create a form with the following details.
details.
Form | Form Link Name | Field Type | Field Name | Field Link Name |
Product | Product | Dropdown | Product Group | Product_Group |
Single line | Product Name | Product_Name |
Number | IMEI Number | IMEI_Number |
Image | IMEI Barcode* | IMEI_Barcode |
Add Notes | Add Notes | plain
|
4. Click Add New Action and add the following snippet:
5. Add a few records to this app.
6. Now let's build another app named
Mobile Phone Servicing.
Create a form with the following details.
Form | Form Link Name | Field Type | Field Name | Field Link Name |
Product | Product | Number | IMEI | IMEI |
| | Dropdown | Product Group | Product_Group |
Single line | Product Name | Product_Name |
Multi Line | Issue | Issue |
8. Select Zoho OAuth
9.Select the required scopes for Creator, fill in other details, and click Create and Authorize.
Ensure that the connection is
enabled for this app.
11. Click Add New Action and save the following script in the deluge editor.
- //fetch data using integration task and replace the parameters according to your application
- mobileData = zoho.creator.getRecords("<app_owner>","order-management","All_Products","IMEI_Number==" + input.IMEI,1,200,"creator");
- record = mobileData.get("data");
- input.Product_Name = record.getJSON("Product_Name");
- input.Product_Group = record.getJSON("Product_Group");
See how it works
Points to note
- This tutorial uses an open-source barcode generator API to achieve the desired result. You can use any API you wish to generate the barcode.
- The same procedure can also be used to generate any coded image. For example, use the below script to generate QR code instead of barcode:
- Data can also be fetched from other apps using functions API.
- Functions
- Call Function
- Creator Fetch API
- Creator Fetch Records Integration Task
- Connections