Send Data From Flutetr App To Exel Sheet
2- Create a Blank Sheet with Column name ( In our case we have four field (nom, email, contact, feedback))
In the url of your Sheet we have : https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=0
function doGet(request) {
var sheet = SpreadsheetApp.openById('____YOUR_SHEET_ID_HERE___');
var result = {'status':"SUCCESS"};
try{
var nom = request.parameter.nom;
var email = request.parameter.email;
var contact = request.parameter.contact;
var feedback = request.parameter.feedback;
var rowData = sheet.appendRow([nom, email, contact, feedback])
}catch(exc){
result = {'status':"FAILED", "message":exc};
}
return ContentService
.createTextOutput(JSON.stringify(result))
.setMimeType(ContentService.MimeType.JSON);
}
- Above the editor click on Run
- If you have an Function Error Click on run again
- Allow acces to the App
- On the Right_Top of the App Script Editor click on Deploy > New Deployment
- Give Deploy Name
- Select Web App type and deploy
- Allow all acces to anyone that have the link
- Copy the deployment url and paste it in your navigatr (it must show reponse : {"status":"SUCCESS"})
- if the last action is ok do next , if not resume all the previous process
- Copy the deployment url and paste it in ib > models > controller.dart in URL section