Widget to seach and display value from google spreadsheet.

  • Profile Image
    gillmantisnetworks
    Asked on June 28, 2017 at 02:33 AM

    Hi

    I would like to develop a widget that allows the user to enter a registration number, looks up the corresponding company name off a Google sheet and then displays the company name on the JotForm before the form is submitted.

    (I think I can figure out the Google Sheet lookup bit). I just want to know if it is possible (and how) to display the company name before submission.

    Thanks

    Gill

    Currently my code is:

    <!DOCTYPE html>

    <html>

    <head>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    <script src="//js.jotform.com/JotFormCustomWidget.min.js"></script>

                            

    <script>

    $(document).ready(function(){

    // CODE TO GET COMPANY CODE FROM SHEET //

    }

    </script>

    </head>

     

    <body>

    <div id="main">

    <h3>Registration to Company Mapping Widget</h3>

    <span id="labelText"></span>

    <input type="text" id="regNumber">

    </div>

     

    <script type="text/javascript">

     

    JFCustomWidget.subscribe("ready", function(){

    var label = JFCustomWidget.getWidgetSetting('regParam');

    document.getElementById('labelText').innerHTML = label;

     

    JFCustomWidget.subscribe("submit", function(){

    var msg = {

     

    valid: true,

    value: document.getElementById('regNumber').value

    }

     // I ASSUME IT IS SOMEWHERE AROUND HERE I WOULD SHOW COMPANY NAME //

    JFCustomWidget.sendSubmit(msg);

    });

    });

    </script>

     

    </body>

    </html>

  • Profile Image
    ashwin_d
    Answered on June 28, 2017 at 03:31 AM

    Hello,

    Unfortunately we do not have such feature. It is currently not possible to get the data from any external source. The only possibility for now is to get your form's full source code and add your custom script code to fetch data from google spreadsheet.

    I am creating a feature request ticket and forwarding it to our backend team. Please note that creating a feature request ticket does not ensure that feature will be implemented. It completely depends upon the feasibility and priority of our backend team.

    I would also suggest you to please take a look at our "Spreadsheet to form" widget and see if that fits into your requirement.

    Thank you!

  • Profile Image
    gillmantisnetworks
    Answered on June 29, 2017 at 03:39 AM

    Thank you. "Spreadsheet to form" widget does just what I was looking for.