Hi, In my appsheet app I have a table for items.
It contains data like:
Item name:
Item SKU
Item Photo:
and so on.
I want to make auto qr code for an item and then print it on item's box so that once it is scanned it shows the item detail form within appsheet app.
I found some resources today and applied (code is here)
CONCATENATE(“https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=”,ENCODEURL("https://www.appsheet.com/start/---------------------------------------------------------------------..."),[_thisrow].[SKU])
But now the problem is that the scan result is only shown on a note or text format but I rather want to show the full item detail inside my appsheet directly.
Solved! Go to Solution.
I think you’re having the same issue as me. The QR Code doesn’t open in full view. It’s truncated so it doesn’t 100% work. Click on the QR Code and click on the box on upper right corner and you’ll see the QR Code in full view. Try scanning it and you’ll see that it will open to the right record.
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Full-size-image-in-detail-view/m-p/722276
I am using QR Codes for Asset Management through Appsheet. The QR code contains URL of the form https://www.appsheet.com/start/{app-id}#control={ViewName_Detail}&row={key}
Scanning this QR directly opens the Detail View of particular asset inside Appsheet
Thanks @jyothis_m
But how can I form the final formula to link your appsheet url and the qr image as well.
Cause my url generates the qr image of 500x500
CONCATENATE(“https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl="&substitute([SKU];" “;”%20"))
and your url opens the form view of the appsheet
https://www.appsheet.com/start/{app-id}#control={ViewName_Detail}&row={key}
I made the url like this
https://www.appsheet.com/start/MyAppID#control=Items_Detail&row=MyRowID
and now it opens to the exact detail view row inside appsheet
But how can I make the qr code image that auto link to above url so once I scan it open the row inside appsheet and how can I show it for each row.
You can make use of QR Generator Services like https://www.qr-code-generator.com/ and use their api to generate QR codes directly. Make a column in table named QR Code of type IMAGE and use the App formula in APPSHEET as given below
"https://api.qr-code-generator.com/v1/create?access-token={your_token}&qr_code_text="&ENCODEURL("https://www.appsheet.com/start/MyAppID#control=Items_Detail&row=MyRowID")&"&qr_code_logo=scan-me-square&frame_name=bottom-frame&frame_color=%2302bfff&frame_text_color=%23ffffff&frame_icon_name=mobile&frame_text="&{QR Code Label Text}&"&image_format=PNG&image_width=300"
Hi this does not work
What issue are you facing
when I scan it, does not open specific row detail.
by the way @jyothis_m would you mind me to pm you the app editor link and browser link to test in your end
is the QR code getting generated successfully and image of QR shown? If so when you scan what is the result of the scan (url) showing
I have messaged you in personal also
Yes it is generated successfully but when I scan it does not go to exact item detail page.
I've made a copy of the app and deleted everything except the item table so that it will easy for you to check. I will pm you now with detail.
I think you’re having the same issue as me. The QR Code doesn’t open in full view. It’s truncated so it doesn’t 100% work. Click on the QR Code and click on the box on upper right corner and you’ll see the QR Code in full view. Try scanning it and you’ll see that it will open to the right record.
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Full-size-image-in-detail-view/m-p/722276
@Mauricio_Bick You are right , now it works
I created a workaround. It’s not pretty but it works. Let me know if you’re interested and I’ll put some instructions together.
Yes It is good idea to share it here @Mauricio_Bick
1. Create a URL for every record in your table.
2. Create a Folder in your Google Drive where the Source of your App lives and name it something like "QR Code PNG".
3. Add a physical column to your sheet. Maybe name it "QR Code Location". It should be of Image type. Add this App Formula Concatenate(“/appsheet/data/(Your App ID)/(Your Folder from Step2)/”,CONCATENATE([(Your Key or Whatever you named the QR Code],”.png”))
4. Create a GAS
This is my script. Modify for your use case.
What the script does it gets the URL from my sheet and creates a QR Code and then saves it as a PNG in the "QR Code PNG" folder. The script uses column A from my sheet to name the QR Code when it saves it to the "QR Code PNG".
function onEdit(e) {
// Column AC index and Sheet name
const targetColumnIndex = 29; // Column AC
const sheetName = '(Your Sheet Name)';
// Check if the edit is on the correct sheet and in column AC
if (e.range.getSheet().getName() === sheetName && e.range.getColumn() === targetColumnIndex) {
const editedRow = e.range.getRow();
const equipmentName = e.range.getSheet().getRange(editedRow, 1).getValue().trim(); // From Column A (Optional)
// Assuming the URL to be encoded in the QR code is in Column AA
const qrCodeUrlData = e.range.getSheet().getRange(editedRow, 27).getValue().trim(); // From Column AA (Your URL column)
// Call the function to generate/update the PNG for this specific row
if (equipmentName && qrCodeUrlData) {
generateOrUpdatePNGForSingleRow(equipmentName, qrCodeUrlData);
}
}
}
function generateOrUpdatePNGForSingleRow(equipmentName, qrCodeUrlData) {
const folderId = '(Step2 “QR Code PNG)'; // Target folder ID
const targetFolder = DriveApp.getFolderById(folderId);
// Use the URL from Column AA for the QR code
const qrCodeUrl = "https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=" + encodeURIComponent(qrCodeUrlData);
const fileName = `${equipmentName}.png`;
// Delete existing file, if it exists
const files = targetFolder.getFilesByName(fileName);
while (files.hasNext()) {
const file = files.next();
file.setTrashed(true);
}
// Generate and save the new QR code image
try {
const response = UrlFetchApp.fetch(qrCodeUrl);
const imageBlob = response.getBlob().setName(fileName);
targetFolder.createFile(imageBlob);
Logger.log(`QR Code PNG generated/updated for ${equipmentName}.`);
} catch (e) {
Logger.log(`Error generating/updating QR for ${equipmentName}: ${e.toString()}`);
}
}
6. Create a BOT to call the script.
7. Make sure to add the "QR Code Location" to your detail view.
Explaining steps is not my forte but I hope this works for you or at least points you to the right direction.
I'm working now on printing the QR Code directly from the app to a thermal printer using an iOS device or from a Windows computer. If anyone has a solution for please share it.
Thank you very much for taking time to show us how you were able to work around this.
for me the QR scan works successfully without clicking the full view though
I’m assuming it has to do with the length of the URL or something because I tried a lot of things without success until I finally figured it out using GAS.
User | Count |
---|---|
16 | |
11 | |
9 | |
8 | |
4 |