Google form refresh on done and bar highlight for barcode

102 vues
Accéder directement au premier message non lu

Justin Sweglar

non lue,
14 sept. 2021, 15:28:2714/09/2021
à Google Apps Script Community

I'm not sure how to get this working. So I'm trying to make a simple check in using google form and sheets. I have built a form which has 1 short answer line limited to a set amount of numbers. The idea is use a barcode scanner which inputs the numbers and hopefully auto enters. Which will put a line in google sheets. But I need the form to refresh and auto select the field ready to use the barcode to scan again and repeat.

The form on finish only has two options show next page or show page with a url link back to the form. Not useful to me.

So with google script app in theory i can reload the page but its not working. I'm to newb to get it working my understanding is the location wont work because it runs at the time of execution.

function onFormSubmit() {
   location.reload();
}

The second problem is for auto highlighting the fill-able field on refresh or when ever a the first blank field is available. I found this code.

textField.setFocus();

I'm unsure how to get this all together to function correct.

I may need 1 additional function to auto enter after hitting a set number with in the text field. But I haven't been able to get beyond finding the functions i think I need to work.

I have looked threw several guides trying to make something work. Was hoping someone could get this functioning correct.





Martin Hawksey

non lue,
14 sept. 2021, 15:47:3414/09/2021
à Google Apps Script Community
Hi Justin,

Unfortunately Google Apps Script can't update a Google Form while it's being used by a user. In terms of your setup are you using a dedicated barcode scanner and scanning existing product barcodes (rather than using your own barcodes)?

Martin

Justin Sweglar

non lue,
14 sept. 2021, 18:47:0414/09/2021
à Google Apps Script Community
I dont want to update it while its being used. The refresh is on form submission and i am hoping to select the text box on entry to form. As for the bar codes the plan is to use a range of barcodes and purchase cards with the range... Then assign a name to the card.

Justin Sweglar

non lue,
14 sept. 2021, 18:50:3014/09/2021
à Google Apps Script Community
I'm still hoping this can be done with the google script stuff... I wonder if it would be better to pull the form to a website where i can do more that way... I suppose worse case I could look into python pull the google api's and do it that way.

Martin Hawksey

non lue,
15 sept. 2021, 03:57:1615/09/2021
à google-apps-sc...@googlegroups.com
Hi Justin,

I've seen a couple of barcode/Google Sheet solutions in the past. Some have gone down the Google Form route and accepted the shortcomings of users having to click on buttons. With Google Apps Script there is the option to publish your own Web App. This gives you more control to create a web based UI, downside is you have to do all the HTML form coding. I've an old tutorial for creating a web app here https://github.com/mhawksey/html-form-send-email-via-google-script-without-server Advantage of a Web App is no server hosting cost but there are limits like the number of people who can use the webapp at the same time (anything over 30 simultaneous users can start problems).

University of Georgetown started a similar barcode/Sheets project with Apps Script, but when they needed to scale, switched to something else. Their code for this is published here https://github.com/Georgetown-University-Libraries/BarcodeInventory

Hope this helps
Martin 

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message