Función Logger con función Get ó Post

Hola buenas tardes,
presento la siguiente novedad,
tengo estas funciones doPOST y doGET sin embargo quisiera,
visualizar las ejecuciones que causan error,
ó al menos ver el id del producto que presentó el inconveniente.
se me ocurre con un Logger.log()
ó con un console.log(),
sin embargo no ninguno de los dos valores los imprime
para visualizar el registro,
¿Tienen alguna idea para poder visualizarlo?
También pensaba con un return,
para que enviara un mensaje a la app mit inventor,
sin embargo en la busqueda de la información en una base de datos en google sheets,
se demora aproximadamente 1:30 seg en cargar,
y es un poco molesto para el cliente.
¿Creen que existe otra estrategia?
Muchas gracias!!

image


You do not provide enough information about your script (please show function time(e) as well and show an example of the parameters you are sending to the script (a full url would help, in text, not an image). Also show your relevant blocks/screenshots from your app. Yes, you are missing the required return statements from your code. It should not be taking 90 seconds to return data from the script.

1 Like

Mira @TIMAI2 ,
adjunto el .aia de la app,
y el link del Script
https://script.google.com/d/1ERfyXn9_fScc-SydJytB2A3V0MgVmpgyT-ZsDBhNq5ThVc07fi73T7zm/edit?usp=sharing
APPCIEMPIES (1).aia (777.6 KB)

Esta es la imagen que almacena las variables para enviar


Este es uno de los ejemplos como hace el llamado de la appscript,
y el envió de los parametros
El screen que se esta usando es ScanCPJMB

Mira este es el tiempo de ejecución que estoy presentando para
enviar la información

You have a very long and complicated script in time() !! This perhpas explains the reason for the time it takes?
And a very complicated spreadsheet !!

The execution list shows that the script is completing successfully, but perhaps not doing what you require ?

For testing purposes, I would recommend that you simplify for time() script to a single action, get that working and reporting as required, then extend this to your full script section by section.

Vale te agradezco mucho!,
tendré en cuenta las recomendaciones,

Mira estaba haciendo pruebas sencillas pero...
no me muestra el registro del id enviado,
quiero saber exactamente cual es id que se registra,
lo intenté con un log,
y con un console log y nada,
mmmmmm diferente a un return,
crees que existe algún modo de ver esta información?
¿desde el panel de app script?

function doPost(e){
impresion(e.parameter.id);
Logger.log(e.parameter.id);
Logger.log("hola");
}
function impresion(e) {
vectorcodigociempies = new Array();
vectorcodigociempies.push(e);
var codigociempies=vectorcodigociempies[0];
console.log("hola");
console.log(codigociempies);
Logger.log(codigociempies);
Logger.log("hola");
}

function doPost(e){

<your code here>

return ContentService.createTextOuptut(e.parameter.id);

}

This will return the value (that you sent to the script, so you already have this) of e.parameter.id

You can only have one return in a function, use a variable if you want to return a different value in a different part of your script, then send this variable in your ContentService

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.