Spreadsheet to Form Widget: preload from URL & autorun

  • Ontrex
    Asked on January 18, 2018 at 1:35 PM

    Hello,

    I'm trying to get data from an Excel Sheet into fields of my form, conditionally based on an input value.

    I'm trying to use the spreadsheet to form wizard, but I have trouble in automating it.

    I can call my form https://form.jotformeu.com/80174552184355 and type some data into the input field of the widget (e.g. 101 or 102) and then click on the "Auto Complete Fields" button and the other fields will be filled from the corresponding row in my Excel Sheet. So this does work ok.

    However, first thing I want to do is that I want to get the input field filled via URL, so I would call my form with https://form.jotformeu.com/80174552184355?xls=101 ("xls" being the unique name in the advanced question properties for the widget). But the value is not auto-filled. Is it not possible to fill the widget's input field like one would do with a basic form element?

    Secondly, I wouldn't want to have my users to manually click the "Auto Complete Fields", but would like to create a condition like "if input field is filled, automatically complete the fields". I would then be able to also hide the widget and all the corresponding fields from view, as I do only need those input values later in emails and submission overview. However, the possible conditions I see in the forms settings don't seem to have that capability. Is there a way to automate the widget?

    Or perhaps there is a complete different way to solve my initial problem, which is that I would only to have a userid as the parameter in my URL and want to somehow convert this number into firstname, lastname, email etc. of an user (I do know the userids and corresponding data beforehand, e.g. have it in an Excel sheet)

    Thank you.


  • Marvih
    Replied on January 18, 2018 at 2:36 PM

    Unfortunately, you cannot pre-populate "Spreadsheet to form" since widgets are loaded on a separate iFrame.

    You can use this app to pre-populate fields https://prepopulate.jotform.io/


    Since you cannot pre-populate widgets, you cannot also do automation such as the one you mentioned to not manually click the "Auto Complete Fields".

    I guess this is possible only if you download your forms FULL SOURCE code and add custom scripts to function it the way you wanted.


    Hope this helps.

  • Ontrex
    Replied on January 18, 2018 at 4:37 PM

    I guess it also wouldn't be possible to conditionally populate the widget's input field from another field on the same form, i.e. set a condition like this one (which unfortunately does not work with the widget, only with regular fields):

    IF uid IS FILLED
    INSERT {uid} INTO xls Sheet

    where "uid" is another field on the sheet (which could be populated from an URL like https://form.jotformeu.com/80174552184355?uid=101) and "xls Sheet" is the question text of the widget element.


  • David JotForm Support Manager
    Replied on January 18, 2018 at 4:51 PM

    Unfortunately, the only widget where you can input data through conditions is the Form Calculation widget. So, that would not work, the user needs to manually input the code.