![restapi.png](https://images.hive.blog/DQmeyFojBPBYcxg1mQfVG9jtvpps7oUX6ATCjk44zWUinuU/restapi.png) There are times when you just want a small database to store data and you do not want to create any serious database like Mongo. There are services that help to store form data, but some of them are custom-made and don't look professional. So in this post, I will discuss how to use Google Sheets to store data in real-time. Without further ado, let's start. First, go to: https://docs.google.com/spreadsheets/ and create a blank page. Name the page on whatever you want to save in it. For me, I am using "Players" and add the title of the data you want to collect from your users. I have Name, Rank and Stage in mine ![](https://i.imgur.com/1LBgqqi.png) Click on the share, and change the restriction to "anyone with the link" and change viewer to "editor". Then copy the link. Visit sheet.best, sign up with your gmail and click "Connection". Give your connection a name(same as it is on the Google sheet) then paste the link copied from google sheet in the "Connection URL", and click connect. This will create another DB for you in the sheet.best. ### WHY SHEET.BEST If you try to post directly through a script generated on google Sheets, you may encounter Cross-origin resource sharing issues, This is one of the things sheet.best handles for you ![Screen Shot 20230321 at 9.47.10 PM.png](https://images.hive.blog/DQmNRCuibcDjST55aKRn5FFJth9QJVYiA2CcuZaQqPquvwG/Screen%20Shot%202023-03-21%20at%209.47.10%20PM.png) Click "details" and copy the "connection URL" generated on sheet.best _Note: I am using a free plan of the sheet.best so I can only use 1 Db and I am currently using it for a project._ NEXT... create react app ```npx create-react-app my-app``` and install axios because we will use the post method to save to the sheet. ```npm install axios``` IN YOUR JSX ```import axios from 'axios'; import React, {useState} from 'react'; const Players = () => { const [name, setName] = useState('') const [rank, setRank] = useState('') const [stage, setStage] = useState('') const handleSubmit =(e) => { e.preventDefault(); const data = { Name: name, Rank: rank, Stage: stage } axios.post('https:use-the-link-copied-from-sheet.best-here', data).then((response)=> { // clear field setName(''); setRank(''); setStage(''); }) } return( <div className='form-container'> <form className='form' action="" onSubmit={handleSubmit}> <input type="text" name="Name" id="" placeholder='Name' required onChange={(e)=>setName(e.target.value)} value={name}/> <input type="text" name="Rank" id="" placeholder='Rank' required onChange={(e)=>setRank(e.target.value)} value={rank}/> <input type="text" name="Stage" id="" placeholder='Stage' required onChange={(e)=>setStage(e.target.value)} value={stage}/> <input type="submit" value="submit" /> </form> </div> ) } export default Players; ``` This works in real-time. You can copy this code and adjust to whatever you want. Thanks for your time. Posted using [Proof of Brain](https://www.proofofbrain.io/@tykee/how-to-use-google-sheet-as-a-rest-api)
author | tykee |
---|---|
permlink | how-to-use-google-sheet-as-a-rest-api |
category | hive-150329 |
json_metadata | {"tags":["hive-150329","proofofbrain","tutorial","cent","ctp","neoxian","vyb","programming","stem"],"image":["https://images.hive.blog/DQmeyFojBPBYcxg1mQfVG9jtvpps7oUX6ATCjk44zWUinuU/restapi.png","https://i.imgur.com/1LBgqqi.png","https://images.hive.blog/DQmNRCuibcDjST55aKRn5FFJth9QJVYiA2CcuZaQqPquvwG/Screen%20Shot%202023-03-21%20at%209.47.10%20PM.png"],"links":["https://docs.google.com/spreadsheets/"],"format":"markdown","canonical_url":"https://www.proofofbrain.io/@tykee/how-to-use-google-sheet-as-a-rest-api","app":"proofofbrain/1.1.0"} |
created | 2023-03-22 11:10:33 |
last_update | 2023-03-22 11:10:33 |
depth | 0 |
children | 1 |
last_payout | 2023-03-29 11:10:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 2.408 HBD |
curator_payout_value | 2.363 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3,388 |
author_reputation | 232,935,449,922,164 |
root_title | "How to use Google sheet as a REST API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 121,857,589 |
net_rshares | 9,334,144,226,176 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xeldal | 0 | 1,113,122,561,480 | 2% | ||
adol | 0 | 30,946,925,005 | 2% | ||
enki | 0 | 373,845,256,137 | 2% | ||
eric-boucher | 0 | 1,991,696,534 | 0.4% | ||
thecryptodrive | 0 | 5,550,299,547 | 0.16% | ||
mammasitta | 0 | 2,175,524,911 | 0.4% | ||
roelandp | 0 | 39,354,169,834 | 5% | ||
cloh76 | 0 | 533,137,092 | 0.4% | ||
stea90 | 0 | 609,893,104 | 1% | ||
lordvader | 0 | 7,473,021,591 | 0.8% | ||
lemouth | 0 | 266,191,456,990 | 10% | ||
lamouthe | 0 | 731,796,981 | 10% | ||
tfeldman | 0 | 742,651,739 | 0.4% | ||
mcsvi | 0 | 92,761,725,600 | 50% | ||
cnfund | 0 | 1,508,742,533 | 0.8% | ||
justyy | 0 | 3,824,089,440 | 0.8% | ||
curie | 0 | 91,382,896,300 | 0.8% | ||
modernzorker | 0 | 487,503,495 | 0.56% | ||
techslut | 0 | 23,923,644,618 | 4% | ||
slider2990 | 0 | 2,139,399,737 | 40% | ||
steemstem | 0 | 572,890,433,843 | 10% | ||
edb | 0 | 1,222,263,721 | 1% | ||
walterjay | 0 | 51,164,783,486 | 5% | ||
valth | 0 | 1,504,379,853 | 5% | ||
metroair | 0 | 3,298,166,438 | 0.8% | ||
chesatochi | 0 | 540,569,910,806 | 100% | ||
dna-replication | 0 | 342,714,465 | 10% | ||
privex | 0 | 929,872,194 | 0.8% | ||
dhimmel | 0 | 55,446,141,545 | 2.5% | ||
oluwatobiloba | 0 | 615,426,789 | 10% | ||
detlev | 0 | 2,750,093,932 | 0.24% | ||
federacion45 | 0 | 1,103,174,854 | 0.4% | ||
iansart | 0 | 1,181,364,526 | 0.4% | ||
forykw | 0 | 3,046,149,829 | 0.4% | ||
mobbs | 0 | 5,326,197,744 | 5% | ||
jerrybanfield | 0 | 2,724,706,144 | 0.8% | ||
rt395 | 0 | 1,555,287,949 | 1.5% | ||
bitrocker2020 | 0 | 1,513,190,293 | 0.12% | ||
maxdevalue | 0 | 4,095,710,487 | 0.8% | ||
sustainablyyours | 0 | 4,388,498,182 | 5% | ||
arunava | 0 | 973,362,214 | 0.08% | ||
juancar347 | 0 | 2,475,707,079 | 0.48% | ||
samminator | 0 | 9,504,710,015 | 5% | ||
alexander.alexis | 0 | 6,002,603,544 | 10% | ||
dandesign86 | 0 | 15,220,013,396 | 8% | ||
jayna | 0 | 948,091,918 | 0.16% | ||
princessmewmew | 0 | 1,024,691,442 | 0.4% | ||
grapthar | 0 | 980,534,112 | 0.6% | ||
gunthertopp | 0 | 10,684,512,675 | 0.2% | ||
empath | 0 | 541,348,621 | 0.4% | ||
flatman | 0 | 694,839,536 | 0.8% | ||
minnowbooster | 0 | 1,133,922,544,569 | 20% | ||
felt.buzz | 0 | 1,826,086,586 | 0.2% | ||
tsoldovieri | 0 | 1,001,806,773 | 5% | ||
steemwizards | 0 | 524,870,218 | 0.8% | ||
neumannsalva | 0 | 619,233,614 | 0.4% | ||
stayoutoftherz | 0 | 20,315,435,619 | 0.2% | ||
abigail-dantes | 0 | 3,604,301,713 | 10% | ||
sanjeevm | 0 | 1,934,516,534,642 | 50% | ||
investingpennies | 0 | 1,967,377,284 | 0.8% | ||
mamalikh13 | 0 | 2,346,898,374 | 0.8% | ||
zyx066 | 0 | 732,277,897 | 0.24% | ||
revo | 0 | 1,518,803,435 | 0.8% | ||
djlethalskillz | 0 | 1,670,958,638 | 5% | ||
rocky1 | 0 | 115,236,090,333 | 0.12% | ||
thelordsharvest | 0 | 695,691,756 | 0.8% | ||
aidefr | 0 | 1,023,336,343 | 5% | ||
joshman | 0 | 145,778,302,830 | 25% | ||
sorin.cristescu | 0 | 1,499,973,456 | 0.4% | ||
therealwolf | 0 | 4,794,763,892 | 0.4% | ||
fatman | 0 | 8,927,197,230 | 2% | ||
meno | 0 | 2,921,334,759 | 0.4% | ||
isnochys | 0 | 6,620,434,525 | 3.4% | ||
bhoa | 0 | 516,859,936 | 5% | ||
enzor | 0 | 567,247,786 | 10% | ||
bartosz546 | 0 | 709,325,048 | 0.4% | ||
dandays | 0 | 2,427,524,553 | 0.28% | ||
sonu084 | 0 | 1,806,182,543 | 100% | ||
anadolu | 0 | 280,574,742,342 | 50% | ||
sunsea | 0 | 547,669,090 | 0.4% | ||
postpromoter | 0 | 203,323,754,297 | 10% | ||
steveconnor | 0 | 629,214,483 | 0.4% | ||
nicole-st | 0 | 2,701,440,241 | 0.4% | ||
smartsteem | 0 | 19,706,381,465 | 0.4% | ||
ugurarslanboga | 0 | 610,928,307 | 40% | ||
aboutcoolscience | 0 | 506,705,965 | 10% | ||
sandracarrascal | 0 | 3,388,874,431 | 5% | ||
turkiye | 0 | 3,830,714,124 | 50% | ||
kenadis | 0 | 2,660,935,691 | 10% | ||
robotics101 | 0 | 2,929,806,889 | 10% | ||
punchline | 0 | 2,099,353,770 | 0.8% | ||
r00sj3 | 0 | 19,296,065,822 | 5% | ||
sco | 0 | 2,605,883,838 | 10% | ||
brotherhood | 0 | 2,727,736,821 | 0.8% | ||
intrepidphotos | 0 | 178,346,810,966 | 7.5% | ||
fineartnow | 0 | 515,753,419 | 0.4% | ||
oscarina | 0 | 747,954,633 | 10% | ||
communitybank | 0 | 1,009,260,556 | 0.8% | ||
fragmentarion | 0 | 2,569,719,699 | 10% | ||
utube | 0 | 653,786,285 | 0.8% | ||
belemo | 0 | 56,662,946,258 | 100% | ||
coinmeria | 0 | 762,577,655 | 35% | ||
dynamicrypto | 0 | 1,179,031,701 | 1% | ||
neneandy | 0 | 883,408,194 | 0.8% | ||
pab.ink | 0 | 6,465,234,282 | 5% | ||
sportscontest | 0 | 797,747,089 | 0.8% | ||
pandasquad | 0 | 1,469,830,261 | 0.8% | ||
darewealth | 0 | 3,488,241,075 | 100% | ||
fantasycrypto | 0 | 623,029,722 | 0.8% | ||
atma-yoga | 0 | 525,933,857 | 50% | ||
photohunt | 0 | 492,992,517 | 0.8% | ||
geopolis | 0 | 615,357,978 | 10% | ||
robertbira | 0 | 1,039,002,741 | 2.5% | ||
alexdory | 0 | 1,434,148,449 | 10% | ||
takowi | 0 | 14,783,826,071 | 0.8% | ||
irgendwo | 0 | 2,601,923,141 | 0.8% | ||
cyprianj | 0 | 5,780,227,012 | 10% | ||
melvin7 | 0 | 3,263,476,937 | 5% | ||
francostem | 0 | 1,327,975,345 | 10% | ||
technologix | 0 | 488,808,057 | 0.8% | ||
cryptictruth | 0 | 1,977,787,579 | 0.5% | ||
superlotto | 0 | 2,078,129,800 | 0.8% | ||
bscrypto | 0 | 1,944,570,043 | 0.4% | ||
movingman | 0 | 1,218,395,619 | 20% | ||
muratkbesiroglu | 0 | 187,283,927,254 | 15% | ||
sanderjansenart | 0 | 667,412,812 | 0.4% | ||
qberry | 0 | 489,166,212 | 0.4% | ||
greddyforce | 0 | 582,162,328 | 0.29% | ||
braaiboy | 0 | 1,879,756,336 | 0.4% | ||
gadrian | 0 | 44,429,171,764 | 7.5% | ||
lordbutterfly | 0 | 180,039,822,741 | 10% | ||
therising | 0 | 13,813,432,574 | 0.8% | ||
de-stem | 0 | 5,392,711,792 | 9.9% | ||
imcore | 0 | 881,942,787 | 10% | ||
meanbees | 0 | 11,900,979,300 | 10% | ||
deholt | 0 | 534,761,609 | 8.5% | ||
diabonua | 0 | 705,247,090 | 0.4% | ||
minerthreat | 0 | 488,045,133 | 0.4% | ||
nateaguila | 0 | 142,453,727,203 | 5% | ||
temitayo-pelumi | 0 | 816,470,143 | 10% | ||
bilimkurgu | 0 | 519,197,161 | 50% | ||
motherofalegend | 0 | 718,887,586 | 5% | ||
carilinger | 0 | 14,486,338,108 | 2% | ||
doctor-cog-diss | 0 | 7,673,084,623 | 10% | ||
dailyspam | 0 | 15,792,657,445 | 50% | ||
uche-nna | 0 | 684,101,270 | 0.64% | ||
citizendog | 0 | 678,474,884 | 0.8% | ||
cheese4ead | 0 | 542,426,501 | 0.4% | ||
mafufuma | 0 | 7,385,471,890 | 1% | ||
nattybongo | 0 | 2,983,155,478 | 10% | ||
talentclub | 0 | 935,922,875 | 0.48% | ||
roozeec | 0 | 490,432,340 | 10% | ||
esteliopadilla | 0 | 800,715,446 | 100% | ||
bflanagin | 0 | 995,674,626 | 0.4% | ||
armandosodano | 0 | 1,660,023,982 | 0.4% | ||
goblinknackers | 0 | 69,660,061,909 | 7% | ||
kylealex | 0 | 4,687,672,240 | 10% | ||
cubapl | 0 | 560,508,287 | 5% | ||
ozeryilmaz | 0 | 526,273,678 | 50% | ||
thelittlebank | 0 | 3,185,598,503 | 0.4% | ||
pboulet | 0 | 12,703,191,658 | 8% | ||
cliffagreen | 0 | 4,414,278,449 | 10% | ||
merlin7 | 0 | 1,570,841,035 | 0.8% | ||
brianoflondon | 0 | 5,290,212,183 | 0.12% | ||
kristall97 | 0 | 25,832,295,543 | 100% | ||
steemcryptosicko | 0 | 1,459,325,310 | 0.16% | ||
cakemonster | 0 | 688,996,478 | 0.8% | ||
stem.witness | 0 | 547,654,984 | 10% | ||
jacuzzi | 0 | 1,652,191,969 | 0.12% | ||
vaultec | 0 | 4,048,457,228 | 12% | ||
steemstorage | 0 | 977,408,498 | 0.8% | ||
crowdwitness | 0 | 8,414,564,732 | 5% | ||
limka | 0 | 116,643,927 | 79.94% | ||
steemean | 0 | 10,087,305,540 | 5% | ||
hungryharish | 0 | 23,217,782,893 | 100% | ||
cryptofiloz | 0 | 1,370,773,588 | 0.8% | ||
projectdignity | 0 | 0 | 1.8% | ||
hungryanu | 0 | 3,438,543,205 | 50% | ||
robibasa | 0 | 26,832,281,073 | 10% | ||
banvie | 0 | 55,393,324,714 | 100% | ||
qwerrie | 0 | 529,130,858 | 0.07% | ||
aicu | 0 | 6,033,961,129 | 0.8% | ||
steemindian | 0 | 4,315,705,223 | 100% | ||
stemgeeks | 0 | 923,201,065 | 40% | ||
stemcuration | 0 | 19,584,346 | 40% | ||
babytarazkp | 0 | 4,082,423,838 | 40% | ||
abh12345.stem | 0 | 1,987,196,076 | 100% | ||
beta500 | 0 | 660,414,002 | 0.8% | ||
electronico | 0 | 1,748,674,897 | 5% | ||
steemstem-trig | 0 | 768,127,029 | 10% | ||
baltai | 0 | 902,607,054 | 0.4% | ||
sandymeyer | 0 | 35,831,033,046 | 1% | ||
yggdrasil.laguna | 0 | 0 | 20% | ||
atheistrepublic | 0 | 764,167,150 | 0.4% | ||
ibt-survival | 0 | 35,759,389,542 | 10% | ||
jennyferandtony | 0 | 1,378,073,019 | 100% | ||
roamingsparrow | 0 | 1,006,163,131 | 0.6% | ||
chapmain | 0 | 0 | 100% | ||
lightpaintershub | 0 | 1,182,896,023 | 1% | ||
yunnie | 0 | 731,045,221 | 100% | ||
stemsocial | 0 | 86,320,507,768 | 10% | ||
penned-bullshit | 0 | 679,330,139 | 100% | ||
veeart | 0 | 1,224,376,722 | 50% | ||
holoferncro | 0 | 4,480,693,900 | 10% | ||
hiveonboard | 0 | 496,247,854 | 0.4% | ||
noelyss | 0 | 3,380,519,709 | 5% | ||
lotusies | 0 | 258,580,190 | 100% | ||
quinnertronics | 0 | 16,043,471,949 | 8% | ||
zartisht | 0 | 392,484,158,669 | 100% | ||
gohive | 0 | 14,426,803,912 | 100% | ||
aabcent | 0 | 1,746,405,970 | 0.64% | ||
dorkpower | 0 | 3,332,862,868 | 100% | ||
stemcur | 0 | 911,853,951 | 100% | ||
brofund-stem | 0 | 627,032,054 | 40% | ||
meritocracy | 0 | 8,707,943,436 | 0.08% | ||
stemline | 0 | 2,495,895,487 | 20% | ||
jmsansan.leo | 0 | 494,836,096 | 0.4% | ||
dcrops | 0 | 6,104,380,343 | 0.4% | ||
krishu.stem | 0 | 356,119,323 | 100% | ||
belemo.leo | 0 | 2,729,865,934 | 100% | ||
scholaris.stem | 0 | 1,698,518,783 | 100% | ||
traderhive | 0 | 1,810,257,464 | 0.8% | ||
drricksanchez | 0 | 1,935,839,321 | 0.4% | ||
imno | 0 | 8,892,373,082 | 20% | ||
juecoree.stem | 0 | 614,980,613 | 100% | ||
nfttunz | 0 | 1,265,135,571 | 0.08% | ||
holovision.stem | 0 | 548,461,319 | 100% | ||
sarashew | 0 | 505,617,233 | 0.8% | ||
podping | 0 | 635,924,700 | 0.12% | ||
star.stem | 0 | 1,470,921,054 | 50% | ||
driplord | 0 | 90,001,852 | 100% | ||
siphon.tribes | 0 | 2,117,666,777 | 50% | ||
laviesm | 0 | 5,747,650,150 | 50% | ||
untzuntzuntz | 0 | 17,597,244,070 | 50% | ||
mmckinneyphoto13 | 0 | 10,409,190,375 | 100% | ||
seinkalar | 0 | 521,673,682 | 0.8% | ||
tanzil2024 | 0 | 689,361,842 | 1% | ||
aries90 | 0 | 6,400,373,318 | 0.8% | ||
spirit09 | 0 | 82,879,624,002 | 100% | ||
centtoken | 0 | 1,723,601,753 | 50% | ||
yixn | 0 | 1,710,454,908 | 0.4% | ||
attentionneeded | 0 | 735,367,613 | 10% | ||
eirth | 0 | 6,023,326,249 | 100% | ||
saboin.stem | 0 | 267,188,614 | 40% | ||
hivefolks | 0 | 2,221,767,162 | 10% | ||
dondido | 0 | 3,522,598,003 | 0.8% | ||
draconiac | 0 | 837,056,641 | 100% | ||
plicc8 | 0 | 615,905,128 | 10% | ||
sbtofficial | 0 | 503,124,148 | 0.4% | ||
pearlsuddy | 0 | 1,371,909,733 | 100% | ||
whitneyalexx | 0 | 1,153,230,847 | 100% | ||
stem-shturm | 0 | 325,949,160 | 98.9% |
<div class='text-justify'> <div class='pull-left'> <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div> Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us! Please consider delegating to the @stemsocial account (85% of the curation rewards are returned). You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. <br /> <br /> </div>
author | stemsocial |
---|---|
permlink | re-tykee-how-to-use-google-sheet-as-a-rest-api-20230323t050755303z |
category | hive-150329 |
json_metadata | {"app":"STEMsocial"} |
created | 2023-03-23 05:07:54 |
last_update | 2023-03-23 05:07:54 |
depth | 1 |
children | 0 |
last_payout | 2023-03-30 05:07:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 565 |
author_reputation | 22,460,214,241,099 |
root_title | "How to use Google sheet as a REST API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 121,884,516 |
net_rshares | 0 |