Add the new module to download the file
Tell it the file to download based on the FileId of the previous module
Feed this modules Data output into the Parse CSV module
@V88_Google Thank you sir! Working as expected. Glide community is the best community!!
I’m going to work on scenario 1 now…Email attachment >Parse CSV to sheets
I’ll report back, hopefully I don’t I hit another snag
In this forum thread near the top is a script written to import CSV files directly into sheets for Glide.
I wouldn’t have the necessary skill to take the script over the finish line. I need only parts of the CSV in specific ordered columns.
I could benefit from a more organized Data Structure but it’s a tangled web of Named Ranges and Uniques in there…
thanks, i’m checking it
You know, I’m trying to read with GAS a JSON file from a payment gateway webhook, in theory, I think I have the code, but when I do the tests nothing happens.
this is the code:
function doGet(e) {
return HtmlService.createHtmlOutput(“request received”);
}
function doPost(e) {
var parametros = JSON.stringify(e.postData.contents);
parametros = JSON.parse(parametros);
var data = JSON.parse(e.postData.contents);
var id_Transaccion = data.IdTransaccion;
var fecha_Transaccion = data.FechaTransaccion;
var resultado = data.ResultadoTransaccion;
var monto = data.Monto;
var cliente = data.Nombre;
var correo = data.Email;
var sheet = "Confirmacion de pedidos";
var hoja = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheet);
var ultima_fila = Math.max(hoja.getLastRow(),1);
hoja.insertRowAfter(ultima_fila);
hoja.getRange(ultima_fila + 1, 1).setValue(id_Transaccion);
hoja.getRange(ultima_fila + 1, 2).setValue(fecha_Transaccion);
hoja.getRange(ultima_fila + 1, 3).setValue(resultado);
hoja.getRange(ultima_fila + 1, 4).setValue(monto);
hoja.getRange(ultima_fila + 1, 5).setValue(cliente);
hoja.getRange(ultima_fila + 1, 6).setValue(correo);
hoja.getRange(ultima_fila + 1, 7).setValue(data);
SpreadsheetApp.flush();
return HtmlService.createHtmlOutput("post request received");
}
I would appreciate if you could review it and tell me something that I am overlooking.
Insert the following line:
console.log(parametros);
That will show you if anything is being posted to the webhook.
when I run the code from GAS it throws me the following error: TypeError: Cannot read property ‘postData’ of undefined
So that suggests that nothing is being posted to the webhook…
well, the idea is the following:
1- from glide through a webview the client makes the payment with his credit card
2- The payment gateway receives the transaction and notifies through a webhook
3- GAS receives the webhook and writes the details on the spreadsheet
4-finalize the purchase process in glide
that’s the general idea of what i’m trying to do, but i’m in an alley with the script
Just based on the error message you have, it appears that it is failing at step 2.
Sorry, I can’t really offer much more than that.
I understand your point, and I appreciate your time … verify that the payment gateway will send the confirmation using integromat, and with that service if I found the configuration, but I need it in GAS
I copied this script but wasn’t able to make it run. I bet it’s due to my poor understanding on the whole thing and the trigger setting.
Any tutorial or how can I get it started?
@Darren_Murphy hi!
Возникли проблемы с созданием столбцов, определяемых пользователем, для временного хранения входного значения.
Как это сделать?
Thanks. Yes, i read it. It is not clear exactly in the part “for temporary storage of the input value”.
Going back to my example, the template column is a concatenation of 3 columns: Name, Age & Sex
- I would have 3 corresponding User Specific Columns: usc-name, usc-age, and usc-sex
- In my form layout, I would have 3 input components. Each of those would use one of those user specific columns as the target
- I would then have a second template column that concatenates the 3 user specific columns
- And these two template columns are used to create a relation column, which in turn will indicate whether or not a duplicate has been created
Does that explanation help?
Yes, thanks)
So I understood you correctly the first time
According to the script, I am having difficulty to execute the notification.
function Twilio() {
var ss = SpreadsheetApp.getActive().getSheetByName("Notifications");
var values = ss.getRange("A2:H").getValues();
for (var i in values) {
var row=i;
var r = +row + 2;
if (values[i][5] != '' && values[i][7] == '' ) {
var number = values[i][5]
var message = values[i][6]
function sendSms(to, body) {
var messages_url = "Your Twilio URL";
var payload = {
"To": to,
"Body" : body,
"From" : "Twilio phone number"
};
var options = {
"method" : "post",
"payload" : payload
};
options.headers = {
"Authorization" : "Basic " + Utilities.base64Encode("Your API Code")
};
UrlFetchApp.fetch(messages_url, options);
}
try {
response_data = sendSms(number, message);
status = "sent";
} catch(err) {
Logger.log(err);
status = "error";
}
ss.getRange(r, 8).setValue(status);
}
if (values[i][5] == '' && values[i][7] == '' ) {
Utilities.sleep(1000);
var mail = values[i][2]
var message = values[i][6]
var row = +i + 2
ss.getRange(row, 8).setValue("Email Sent");
MailApp.sendEmail(mail, "Your Subject line", message, {name:"name of sender"})
SpreadsheetApp.flush();
}
}
}
Can someone assist? @Darren_Murphy T,T
Stucked at triggering.
What happens when you try to execute the script?
Do you see an error message?
Sharing that might help us to help you…
PS. When posting code, please enclose with 4 back ticks (````) before and after (I fixed that for you)