oc1ober Posted February 19, 2021 Share Posted February 19, 2021 (edited) I found a snippet of code to get data from a cell in a Google sheet into an HTML input ... It works fine, but not met ... My requirement is that it should work. after I press the button, do not automatically run when opening or loading the Web page as it is now ... Can you please fix it according to my mind, Thank you very much in advance. <html> <body> <input name="form1_1" id="f1_1" type="text" /> <button name="submit_form1" id="submit_form1" type="button" onclick="">Click here to get data</button> </body> <script> const onDataLoaded = (data) => { const e20Content = data.feed.entry.find((entry) => entry.title.$t == 'E20').content.$t document.getElementById('f1_1').value = e20Content } </script> <script src="https://spreadsheets.google.com/feeds/cells/1TbMrtJl01i-Q5YudlhdAB_E1LTYkkLswnql5LHyiIuk/1/public/basic?alt=json-in-script&callback=onDataLoaded"></script> </html> Edited February 19, 2021 by oc1ober Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now