Programa de Gestion de Taller

Buenas, gracias por tu aporte pero el problema continua a pesar de usar una etiqueta para mostrar el resultado.

En si la aplicación web cumple lo que se espera, pero aún no logro mostrar ello en una etiqueta o lista (lo cual fuera ideal).

Dejo un ejemplo respecto a lo que se obtiene por medio de la aplicación web.

IMG-20240520-WA0027

The error message shows that you are receiving html back in your response

image

not a fully formatted json string

We need to see the full html being returned, which will hopefully indicate the error being generated by the google apps script.

You cannot rely on AI to be completely accurate when providing instructions for AppInventor / Google Apps Script. It would be better to consult tutorials for both!

https://script.googleusercontent.com/macros/echo?user_content_key=l179U4iuN1048WmLeUljdxknrnpRk1DhOEj4soFWoWeBFpda-u_i3HotjFWeDKvUIDNB0wGWNnIg1ftQfD5dWXmymd7P3vpHOJmA1Yb3SEsKFZqtv3DaNYcMrmhZHmUMWojr9NvTBuBLhyHCd5hHaySl3VmcE6PimAScoypP3jJKjCflLVOgGMd08oc5IZgLtLiLZsPhDEt6JsMi3xt9UscQ-4vZhlInuu1Lp760tRk5hu-MRFPpxLtt5KlkUDl4-VpqExZPZAs0Ve5jl97pz6ioI9ws62ahk-OpaQv_pU8&lib=MbEdZp-TiluD4azkog41LNxY_38wU5Na4

Ese es la full url que devuelve en respuesta

Si lo sé, pero no soy muy partidario del uso de tutoriales en inglés.
Además de no encontrar personas que tienen este tipo de problemas y que estén en la disposición de ayudar.
Es por ello que aprecio el feedback.

You have provided a url, not the html output being generated by the script in your response content

1 Like

Primeramente
Gracias por compartir tu hilo.

Segundo.
Lo que me genera en "teoría" es una linea de comando jSon dónde están todos los datos de la fila.
(Datos en fila y encabezado).

"theory" is no good, we need in practice....

You could also show the call you are making to your google apps script

La llamada está estructurada así.

Francamente no entiendo porque sigue el error.

Should have asked for the call earlier :wink:

Looking at your script, you need to be sending at least two parameters to it, you only seem to be "trying to send" the contents of a textbox.

Url structure should be:

https://<scriptUrl -  ending with - /exec>?accion=<value>&placa=<value>

vaya, no me habia percatado que el campo de accion debia ser definidio, gracias por hacermelo notar.

redefino el scrip:]

var ssId = "HOJA DE CALCULO";

function doGet(e) {
  if (!e || !e.parameter) {
    return ContentService.createTextOutput("")
      .setMimeType(ContentService.MimeType.TEXT);
  }

  var placa = e.parameter.placa;

  if (!placa) {
    return ContentService.createTextOutput("")
      .setMimeType(ContentService.MimeType.TEXT);
  }

  var datos = buscar(placa); 

  var respostaJSON = JSON.stringify(datos);
  return ContentService.createTextOutput(respostaJSON)
    .setMimeType(ContentService.MimeType.JSON);
}

function buscar(placa) {
  var sh = SpreadsheetApp.openById(ssId);
  var hoja = sh.getSheetByName('Respuestas'); // Accedemos a la hoja llamada 'Respuestas'

  if (!hoja) {
    return [];
  }

  var datos = hoja.getDataRange().getValues();
  var resultados = [];

  // Recorrer todas las filas para buscar coincidencias en la columna D (PLACA)
  for (var i = 0; i < datos.length; i++) {
    var fila = datos[i];
    var valorColumnaD = fila[3]; // Índice 3 corresponde a la columna D (PLACA)

    if (valorColumnaD == placa) {
      resultados.push({
        "OT": fila[1],             // Columna B
        "FECHA": fila[2],          // Columna C
        "PLACA": fila[3],          // Columna D
        "TECNICO": fila[4],        // Columna E
        "MODELO": fila[6],         // Columna G
        "TRABAJO": fila[7],        // Columna H
        "MANTENIMIENTO": fila[8],  // Columna I
        "ESTADO": fila[9]          // Columna J
      });
    }
  }

  return resultados;
}

Ahora si acepta el tipo de respuesta pero aun sigo teniendo problemas para visualizarlo.

https://script.google.com/macros/s/AKfycbxKZ4zZWS9pMlJ8F7UsDKmliS_iYelYBfttE6w4VshAXgWMHredBTq78j7eIZjPf1Cs1Q/exec?placa=[placa]

At Last

This, but all of it, is what we need to see:

Pero no es necesario usar el decodificador de textojson para poder sacar lo que deseamos mostrar?

Porque hasta donde yo veo es una dirección httml lo UE se muestra en la etiqueta.
O como hago para solo mostrar los datos de modelo correspondiente a la búsqueda en la etiqueta?

yes, but currently you get an error message back...
first you have to understand the error message before fixing the issue and get a correct result back...
unfortunately you are truncating the error message, so we still do not know, what the error is about

Taifun

Mis disculpas.
Selecciono y copio todo tal y como aparece.

<!doctype html>c-wiz{contain:style}c-wiz>c-data{display:none}c-wiz.rETSD{contain:none}c-wiz.Ubi8Z{contain:layout style}@-webkit-keyframes quantumWizBoxInkSpread{0%{-webkit-transform:translate(-50%,-50%) scale(0.2);-webkit-transform:translate(-50%,-50%) scale(0.2);-ms-transform:translate(-50%,-50%) scale(0.2);-o-transform:translate(-50%,-50%) scale(0.2);transform:translate(-50%,-50%) scale(0.2)}to{-webkit-transform:translate(-50%,-50%) scale(2.2);-webkit-transform:translate(-50%,-50%) scale(2.2);-ms-transform:translate(-50%,-50%) scale(2.2);-o-transform:translate(-50%,-50%) scale(2.2);transform:translate(-50%,-50%) scale(2.2)}}@keyframes quantumWizBoxInkSpread{0%{-webkit-transform:translate(-50%,-50%) scale(0.2);-webkit-transform:translate(-50%,-50%) scale(0.2);-ms-transform:translate(-50%,-50%) scale(0.2);-o-transform:translate(-50%,-50%) scale(0.2);transform:translate(-50%,-50%) scale(0.2)}to{-webkit-transform:translate(-50%,-50%) scale(2.2);-webkit-transform:translate(-50%,-50%) scale(2.2);-ms-transform:translate(-50%,-50%) scale(2.2);-o-transform:translate(-50%,-50%) scale(2.2);transform:translate(-50%,-50%) scale(2.2)}}@-webkit-keyframes quantumWizIconFocusPulse{0%{-webkit-transform:translate(-50%,-50%) scale(1.5);-webkit-transform:translate(-50%,-50%) scale(1.5);-ms-transform:translate(-50%,-50%) scale(1.5);-o-transform:translate(-50%,-50%) scale(1.5);transform:translate(-50%,-50%) scale(1.5);opacity:0}to{-webkit-transform:translate(-50%,-50%) scale(2);-webkit-transform:translate(-50%,-50%) scale(2);-ms-transform:translate(-50%,-50%) scale(2);-o-transform:translate(-50%,-50%) scale(2);transform:translate(-50%,-50%) scale(2);opacity:1}}@keyframes quantumWizIconFocusPulse{0%{-webkit-transform:translate(-50%,-50%) scale(1.5);-webkit-transform:translate(-50%,-50%) scale(1.5);-ms-transform:translate(-50%,-50%) scale(1.5);-o-transform:translate(-50%,-50%) scale(1.5);transform:translate(-50%,-50%) scale(1.5);opacity:0}to{-webkit-transform:translate(-50%,-50%) scale(2);-webkit-transform:translate(-50%,-50%) scale(2);-ms-transform:translate(-50%,-50%) scale(2);-o-transform:translate(-50%,-50%) scale(2);transform:translate(-50%,-50%) scale(2);opacity:1}}@-webkit-keyframes quantumWizRadialInkSpread{0%{-webkit-transform:scale(1.5);-webkit-transform:scale(1.5);-ms-transform:scale(1.5);-o-transform:scale(1.5);transform:scale(1.5);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}@keyframes quantumWizRadialInkSpread{0%{-webkit-transform:scale(1.5);-webkit-transform:scale(1.5);-ms-transform:scale(1.5);-o-transform:scale(1.5);transform:scale(1.5);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}@-webkit-keyframes quantumWizRadialInkFocusPulse{0%{-webkit-transform:scale(2);-webkit-transform:scale(2);-ms-transform:scale(2);-o-transform:scale(2);transform:scale(2);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}@keyframes quantumWizRadialInkFocusPulse{0%{-webkit-transform:scale(2);-webkit-transform:scale(2);-ms-transform:scale(2);-o-transform:scale(2);transform:scale(2);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}.JnOM6e{background-color:transparent;border:none;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;font-size:14px;height:36px;letter-spacing:.15px;line-height:34px;padding:0 24px;position:relative;text-align:center}.JnOM6e:focus-visible{outline:none;position:relative}.JnOM6e:focus-visible::after{border:2px solid rgb(24,90,188);border-radius:6px;bottom:-4px;-webkit-box-shadow:0 0 0 2px rgb(232,240,254);box-shadow:0 0 0 2px rgb(232,240,254);content:"";left:-4px;position:absolute;right:-4px;top:-4px}.rDisVe:focus:not(:focus-visible),.GjFdVe:focus:not(:focus-visible){-webkit-box-shadow:0 1px 1px 0 rgba(66,133,244,.3),0 1px 3px 1px rgba(66,133,244,.15);box-shadow:0 1px 1px 0 rgba(66,133,244,.3),0 1px 3px 1px rgba(66,133,244,.15)}.rDisVe:hover:not(:focus-visible),.GjFdVe:hover:not(:focus-visible){-webkit-box-shadow:0 1px 1px 0 rgba(66,133,244,.45),0 1px 3px 1px rgba(66,133,244,.3);box-shadow:0 1px 1px 0 rgba(66,133,244,.45),0 1px 3px 1px rgba(66,133,244,.3)}.JnOM6e:disabled{pointer-events:none}.JnOM6e:hover{cursor:pointer}.JnOM6e.kTeh9{line-he

Don't know where you got that from, but it is not the same as the one you show in the screenshot, it is not the error message coming back from the google apps script.

Verdad.
Verifico y vuelvo a enviar.

Ok ahora creo que engo lo correcto.
Use la IA para saber ue está pasando y me indica que es un problema de acceso.
:flushed:

Quedé desconcertado
Una mano, por acá?
:sweat_smile:

PD agrego screen de pantalla, por alguna razón se modifica el post.
:flushed:

<!doctype html>c-wiz{contain:style}c-wiz>c-data{display:none}c-wiz.rETSD{contain:none}c-wiz.Ubi8Z{contain:layout style}@-webkit-keyframes quantumWizBoxInkSpread{0%{-webkit-transform:translate(-50%,-50%) scale(0.2);-webkit-transform:translate(-50%,-50%) scale(0.2);-ms-transform:translate(-50%,-50%) scale(0.2);-o-transform:translate(-50%,-50%) scale(0.2);transform:translate(-50%,-50%) scale(0.2)}to{-webkit-transform:translate(-50%,-50%) scale(2.2);-webkit-transform:translate(-50%,-50%) scale(2.2);-ms-transform:translate(-50%,-50%) scale(2.2);-o-transform:translate(-50%,-50%) scale(2.2);transform:translate(-50%,-50%) scale(2.2)}}@keyframes quantumWizBoxInkSpread{0%{-webkit-transform:translate(-50%,-50%) scale(0.2);-webkit-transform:translate(-50%,-50%) scale(0.2);-ms-transform:translate(-50%,-50%) scale(0.2);-o-transform:translate(-50%,-50%) scale(0.2);transform:translate(-50%,-50%) scale(0.2)}to{-webkit-transform:translate(-50%,-50%) scale(2.2);-webkit-transform:translate(-50%,-50%) scale(2.2);-ms-transform:translate(-50%,-50%) scale(2.2);-o-transform:translate(-50%,-50%) scale(2.2);transform:translate(-50%,-50%) scale(2.2)}}@-webkit-keyframes quantumWizIconFocusPulse{0%{-webkit-transform:translate(-50%,-50%) scale(1.5);-webkit-transform:translate(-50%,-50%) scale(1.5);-ms-transform:translate(-50%,-50%) scale(1.5);-o-transform:translate(-50%,-50%) scale(1.5);transform:translate(-50%,-50%) scale(1.5);opacity:0}to{-webkit-transform:translate(-50%,-50%) scale(2);-webkit-transform:translate(-50%,-50%) scale(2);-ms-transform:translate(-50%,-50%) scale(2);-o-transform:translate(-50%,-50%) scale(2);transform:translate(-50%,-50%) scale(2);opacity:1}}@keyframes quantumWizIconFocusPulse{0%{-webkit-transform:translate(-50%,-50%) scale(1.5);-webkit-transform:translate(-50%,-50%) scale(1.5);-ms-transform:translate(-50%,-50%) scale(1.5);-o-transform:translate(-50%,-50%) scale(1.5);transform:translate(-50%,-50%) scale(1.5);opacity:0}to{-webkit-transform:translate(-50%,-50%) scale(2);-webkit-transform:translate(-50%,-50%) scale(2);-ms-transform:translate(-50%,-50%) scale(2);-o-transform:translate(-50%,-50%) scale(2);transform:translate(-50%,-50%) scale(2);opacity:1}}@-webkit-keyframes quantumWizRadialInkSpread{0%{-webkit-transform:scale(1.5);-webkit-transform:scale(1.5);-ms-transform:scale(1.5);-o-transform:scale(1.5);transform:scale(1.5);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}@keyframes quantumWizRadialInkSpread{0%{-webkit-transform:scale(1.5);-webkit-transform:scale(1.5);-ms-transform:scale(1.5);-o-transform:scale(1.5);transform:scale(1.5);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}@-webkit-keyframes quantumWizRadialInkFocusPulse{0%{-webkit-transform:scale(2);-webkit-transform:scale(2);-ms-transform:scale(2);-o-transform:scale(2);transform:scale(2);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}@keyframes quantumWizRadialInkFocusPulse{0%{-webkit-transform:scale(2);-webkit-transform:scale(2);-ms-transform:scale(2);-o-transform:scale(2);transform:scale(2);opacity:0}to{-webkit-transform:scale(2.5);-webkit-transform:scale(2.5);-ms-transform:scale(2.5);-o-transform:scale(2.5);transform:scale(2.5);opacity:1}}.JnOM6e{background-color:transparent;border:none;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;font-size:14px;height:36px;letter-spacing:.15px;line-height:34px;padding:0 24px;position:relative;text-align:center}.JnOM6e:focus-visible{outline:none;position:relative}.JnOM6e:focus-visible::after{border:2px solid rgb(24,90,188);border-radius:6px;bottom:-4px;-webkit-box-shadow:0 0 0 2px rgb(232,240,254);box-shadow:0 0 0 2px rgb(232,240,254);content:"";left:-4px;position:absolute;right:-4px;top:-4px}.rDisVe:focus:not(:focus-visible),.GjFdVe:focus:not(:focus-visible){-webkit-box-shadow:0 1px 1px 0 rgba(66,133,244,.3),0 1px 3px 1px rgba(66,133,244,.15);box-shadow:0 1px 1px 0 rgba(66,133,244,.3),0 1px 3px 1px rgba(66,133,244,.15)}.rDisVe:hover:not(:focus-visible),.GjFdVe:hover:not(:focus-visible){-webkit-box-shadow:0 1px 1px 0 rgba(66,133,244,.45),0 1px 3px 1px rgba(66,133,244,.3);box-shadow:0 1px 1px 0 rgba(66,133,244,.45),0 1px 3px 1px rgba(66,133,244,.3)}.JnOM6e:disabled{pointer-events:none}.JnOM6e:hover{cursor:pointer}.JnOM6e.kTeh9{line-he

ya decifre el problema
no estaba compartida la aplicacion google para ser ejecutado de forma anonima.

esta guia me sirvio de bastante.
METRIC RAT AI2 - Google Sheets for AppInventor

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