Ayuda con mis bloques, no logro entender el problema de buscar el codigo en una hoja de excel activa

Hola a todos,

He creado una aplicación en App Inventor para gestionar el inventario en mi trabajo. La aplicación debería realizar las siguientes funciones, pero actualmente no está funcionando como espero. Aquí está el detalle de la funcionalidad esperada:

  1. Escaneo de Código de Barras:
  • El usuario presiona un botón (button_1) que activa un escáner de código de barras (BarcodeScanner1).
  • El código escaneado se almacena en item_code.Text.
  1. Detección y Procesamiento de Texto:
  • Si el código escaneado no está vacío, se utiliza el servicio de detección de texto de Google Cloud Vision (GoogleCloudVision1) para procesar el código.
  • El texto detectado se muestra en item_code.Text.
  1. Búsqueda en Hoja de Cálculo:
  • El texto del código (item_code.Text) se busca en la columna "A" (columna 1) de la hoja "Productos" en Google Sheets.
  • Si el código se encuentra, los valores correspondientes en las columnas "B" (columna 2) y "C" (columna 3) de la hoja "Productos" se muestran en description.Text y stock_quantity.Text, respectivamente.
  1. Cálculo de Desbalance:
  • El usuario ingresa la cantidad del producto (quantity) y la ubicación (stockroom).
  • La aplicación calcula la diferencia (textDesbalance.Text) entre la cantidad en el sistema (stock_quantity.Text) y la cantidad ingresada por el usuario (quantity.Text).
  1. Registro de Información:
  • Al presionar el botón de registrar (Registrar.Click), la aplicación valida que item_code.Text, quantity.Text y stockroom.Text no estén vacíos.
  • Si los campos están completos, la información se guarda en la hoja "Inventory" de Google Sheets.
  1. Retorno al Menú Principal:
  • Al presionar el botón de retorno al menú (ButtonReturnToMenu.Click), los campos de entrada se restablecen y la aplicación navega de vuelta a la pantalla principal.

Problemas Encontrados

  1. Búsqueda en la Hoja de Cálculo:
  • La aplicación no busca correctamente el item_code.Text en la columna "A" de la hoja "Productos".
  1. Mensajes de Alerta:
  • Las alertas que deberían mostrarse cuando el número de parte no se encuentra en la hoja de cálculo no aparecen.
    1


    4
    5


    No se porque no busca el codigo en la hoja de calculo y trae la informacion de description y cantidad (stock_quantity en el excel)a la pantalla , estoy usando el primer codigo que esta en la lista productos, ademas si le inclui las advertencias porque no las muestra al usuario cuando ya esta compilado?

Your blocks and images look very similar to this:

Are you the same person, or two different people working on the same project ?

To help you, could I suggest that you simplify, do one thing and get it working, then move onto the next step. In this way you can debug your app as you progress.

You do not show your apps script, which is central to your project. Whilst I can see that you may need this to send data to the spreadsheet, you could use the spreadsheet component to do this with a service account. Alternatively, dispense with the spreadsheet component, and use gviz to do your spreadsheet searches (or expand your apps script). There are several apps script based extensions for google sheets. You also do not show example sheet data, which will help others to help you.

Have you got Google Cloud Vision setup correctly, and by testing does it work as you expect?

What are your scanner outputs, and what does Cloud Vision have to return ?

Hello, no, I don't know that account, I assume that maybe someone is trying to do something similar, the truth is I'm very frustrated because I've already made thousands of changes in a month and I can't get it to do the desired functionality, configure the API and the key json in app inventor, I think that should work, I really don't know, the scanner is more precise now that it includes google vision, I don't know if that has anything to do with it since before it didn't scan the real code, what is expected is what is Scan a barcode of a product, then that code is displayed on the screen in the part number option, make the query with that number in a spreadsheet on the drive and if you find the code, bring the description to the screen and the quantity in the system and then the rest will be included by the user, the spreadsheet that has the data of the products (Item_code, description and stock_quantity), in addition that same book has another sheet that is "inventory" where the data is recorded , the truth is something very frustrating,

This is why you need to test small parts of your code in isolation, before you try to put them all together.