How to pull data from a database?

  • Pinkysh
    Asked on June 15, 2018 at 10:17 AM

    1. Tengo una base de datos, donde vienen 2 columnas (Empleado y función), donde necesito que la condición sea; Si selecciono el empleado 1, en otra celda me arroje automáticamente la función que le corresponde a esa fila. Ejemplo:

    1529072084Tabla Screenshot 10

    Si selecciono la opción "Empleado 2", en otra celda me arroje "Administrador"


    2. Adicional, ¿Existe alguna opción para insertar una casilla de texto, donde escribas y te aparezcan opciones de sugerencia, donde éstas estén siendo alimentadas de una base de datos?


    ¿Es posible hacer eso?

  • Kevin Support Team Lead
    Replied on June 15, 2018 at 11:31 AM

    You may use conditions for that, but you will need to add one condition per employee, this way you will be inserting in the desired field the correct value. 

    Guide: https://www.jotform.com/help/268-How-to-Insert-Text-or-Calculation-into-a-Field-Using-Conditional-Logic 

    However, this means that if you have 100 employees you will need to have 100 conditions in your form. 

    Now, I would recommend you to instead have those employee records in a spreadsheet and then use the Spreadsheet to Form widget, please check this guide in order to get more details about how the widget works: https://www.jotform.com/help/442-How-to-Use-the-Spreadsheet-to-Form-Widget 

    So far, those are the ways we have to achieve what you want. 

    I hope this helps.