Showing posts with label React Native. Show all posts
Showing posts with label React Native. Show all posts

Saturday, February 21, 2026

Creat Register Form React Native to Google Spreadsheet

Create a React Native registration form that sends data to a Google Sheet by creating a Google Form, connecting it to a spreadsheet, generating a POST API URL via Apps Script, and using fetch to submit input data. This approach avoids needing a custom backend server.

Here's how to create a React Native registration form that sends data to a spreadsheet:
Set Up Google Sheet & API
  1. Create a Sheet: Create a new Google Sheet. Add headers, such as Name, Email, and Password.
  2. Create Script: Open Extensions > Apps Script.
  3. Add Code: Use the following code to handle POST requests and add rows:
    javascript
    function doPost(e) {
      const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
      const data = JSON.parse(e.postData.contents);
      sheet.appendRow([data.name, data.email, data.password, new Date()]);
      return ContentService.createTextOutput(JSON.stringify({ 'result': 'success' })).setMimeType(ContentService.MimeType.JSON);
    }
    
  4. Deploy: Click Deploy > New deployment, select Web app, set execute as Me, and Who has access to Anyone. Copy the Web app URL.