Importing editable HTML into Google Sheets - html

I know how to important HTML Data into Google Sheets so that it displays, but I am trying to figure out if it is possible to also copy a web data entry form into Google Sheets, so that you can enter values, which would then be presented by the data.
I am trying to import this calculator into Google Sheets so that I can work with the real time values.
http://www.coinwarz.com/calculators/ethereum-mining-calculator
Any ideas about how I can do this?

I am not aware of any way to import the actual HTML form into Google Sheets. However, here is how I would do it:
I would open Chrome and find the outgoing POST request that occurs when you press the green Calculate button on that site.
I would use Postman to test and create the request and see if it works.
Using Google Apps Script, you can issue HTTP requests. I would re-construct the request being sent in Google Apps Script.
To make it look nicer, you can re-construct the calculator in your Google Sheet. You can recreate the calculator's input buttons as cells and then fetch those cells in your GAS code (like, hash_rate_cell.getValue()):

Related

Using ApI is it possible to edit or open Google Sheet?

Using API to get access_token and now I need to open Google Sheet.
Step 1.
Authorization: Bearer ya29.a0AV...." together with link: "https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit"
Step 2.
Now HTML document back (~200kb). I'm using libcurl for that.
The problem is - missing are some css and js files and I see document just partially. Is there any way to open/edit Google Sheet using API?
I know for the option to just open https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit in the new browser tab, but in that case I need to manually login to Google and that's what I try to avoid, because I want to use API to login and to open/edit a Sheet.
I also know for the option to share a document but I also try to avoid that. I'm writing application to customers who can access they own documents once they confirmed API usage.
I think you may have misunderstood what the google sheets api can do
The Google Sheets API is a RESTful interface that lets you read and modify a spreadsheet's data.
It gives you access to the data, it does not allow you to open the google sheets web application. Your going to have to code your own google sheets type app if you want users to open sheets directly.

Is it possible to enter data into a Website via Google Apps Script?

I am collecting Data via Google Forms, they go into a Google Spreadsheet.
Then I would Google Apps Script to enter the Data into a Webpage Formular.
Is this possible in anyway with Google Apps Script?
Update:
I would like to do Google Apps Script, go to a website( I don’t have control of the website, then get data from a google spread sheet and enter it into the fields then click on certain fields. I know I could to it via puppeteer. But I was thinking google Apps Script has something/sometype to interact with websites.
Not in the way you're thinking. If the target website is not secure you can "fake" a form submission on it by making a POST requesting using UrlFetchApp. But this will most likely not work on most sites.
You can use UrlFetchApp to get the target website but GAS won't render it or let you interact with it like puppeteer will.

On a Google Sheets, is there a way to trigger a Google Script function from a standalone webpage <button>?

I've created a small electron app that shows data from a google sheet via sheetrock.js to display table data. I've added a form that submits data to the google sheet with the help of triblondon's git
Now I'm trying to Implement a simple button on the electron app that will move populated rows from one sheet to another, creating a history. But for the life of me, I can't find a method of doing so that doesn't involve sending json data like the method above, writing to a cell and just doing formulas from there.
I'm just looking for a simpler, more direct approach by just invoking a function on the google script side (button + javascript probably).
Thanks for any help you can provide.
You can deploy your script as apps script. You will have use the public URL to be triggered by your button.
You can check everything about it on the Web Apps documentation.

Google Apps Script : Download PDF responses from Google Forms

I have created a Google form with few responses. I want to download those responses as PDF format into my local pc using a script run by Apps Script. I can't find any apis in Apps Script to do so.
Any ideas? Thank you.
When you have a Form, it will save your responses in a Sheet, as described here. You can export that sheet as PDF following step 2 in this tutorial using the UI.
If you want to use GAS, you can follow this tutorial, to show you how to create an add-on for it. You can also follow this answer to get a single sheet as a PDF.
However, I believe the suggestion of doing it with the UI will work best for you, since each form has only that Spreadsheet associated to it, and it will have only one sheet.

Sync Google Sheets with Web Page HTML

What is the easiest way I can sync a sync a google sheet with a web page form (see attached picture)? Ideally an example code or tutorial.
Here is what I want: I want users to access my web page so they can select their name from a drop-down menu and put it next to the item they wish. Then once they click submit, each person's name value will be transferred from the webpage and then recorded into the corresponding cell inside the google spreadsheet. Then when the next user comes to the site, the fields will auto-populate from the google sheet so he will see who has picked what and what choices are left.
Ideally I would just send the users directly to the google sheet to make their selections, however, they can't edit it on a mobile phone without d/l the app and a bunch of other bogus roadblocks. Google Forms also does not work for this for several reasons.
Some things to keep in mind:
- the spreadsheet is totally public and editable. So I'm hoping to avoid the need to set up an API
- no security or login necessary for the users (I am not worried about if someone changes someone else's name)
I have spent weeks trying to find how to do this but I'm just a construction worker I don't know technology
SYNCING HTML FORM WITH GOOGLE SHEET
From Tanaike,
If you can use the web page as Web Apps of Google, I think that it can achieve what
you want using Google Apps Script, and you can get and put the values
of Spreadsheet. In this case, the Spreadsheet is not required to be
published. The document of Web Apps is [can be found in comments].
– Tanaike 10/19/2018