QR Code to Open Directly in Appsheet App

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 Solved
0 18 623
1 ACCEPTED 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

 

View solution in original post

18 REPLIES 18

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}

 

 

@jyothis_m 

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

@jyothis_m 

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 

@aminsaleh 

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.

@Mauricio_Bick 

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.

Top Labels in this Space