• Resolved benlashley80

    (@benlashley80)


    I need suggestions on how to do this more efficiently please. I am an insurance salesman and i offer several levels of coverage. i’m trying to build a form where clients can choose what coverage they want a quote for. I have 16 different price points for each age group and I have 11 different age groups. So thats 176 price points per product and I have 4 products available that I want built into the form. right now i’m just creating a number field for each price point and having it hidden unless the correct coverage is selected by the radio buttons. I inserted an image of it to help you understand how i’m doing it. this isn’t sufficient because when rates change I have to painfully navigate 704 number fields and change them one by one. Please tell me there is an easier solution to this! Thanks.

    This is my sales app that I use in the field, I don’t want all the prices shown in my form, i just want the price to populate when they select the coverage. the second part of this image is my calculated form, right now if they select individual, single parent, couple, or family, and choose a level, unit 8, unit 4, unit 2, or unit 1, I have a hidden calculated form that ads the sum of each radio button, then the form will display a number field based on that number. this seems like a long work around, it works but is there a better way?

    This is my form, i

    This is my form, I basically have 704 dependency rules that will show the correct number field which has the price pre set in it. please help me make this more efficient thanks!

    here is a link to the actual form where I am building and testing it: https://votesplease.com/testvote/application/

    • This topic was modified 1 year, 2 months ago by benlashley80.
    • This topic was modified 1 year, 2 months ago by benlashley80.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @benlashley80

    Your solution is not optimal. A better alternative is to enter an object with the data definition and access this object directly from the equations.

    For example assuming you have three fields in the form:

    fieldname1, a dropdown field for products with values: Accident & Injuries, …
    fieldname2, a dropdown field for types, with values: Individual, Single parent, Couple, …
    fieldname3, a dropdown field for units, with values: 8, 4, 2, and 1

    Now you need only to insert an “HTML Content” field in the form (tick the checkbox in its settings that allows you to enter script tags in its content), and enter an array of objects:


    <script>
    db = [
    {product: 'Accident & Injuries', type: 'individual', unit: 8, price: 78},
    {product: 'Accident & Injuries', type: 'individual', unit: 4, price: 42},
    {product: 'Accident & Injuries', type: 'individual', unit: 2, price: 24},
    {product: 'Accident & Injuries', type: 'individual', unit: 1, price: 15},
    /* The other tuples with the complete database */
    ];
    </script>

    Finally, the equation that determine the price is as simple as:


    (function(){
    for(let i in db) {
    if(AND(db[i]['product'] == fieldname1, db[i]['type'] == fieldname2, db[i]['unit'] == fieldname3)) return db[i]['price'];
    }
    return '';
    })()

    And that’s all.

    I needed only the fields to allow the users to enter the data for filtering, and an “HTML Content” field for entering the array of tuples (the tuples can include as much information as you want).

    Using DS fields, you can enter your tuples in Google Sheets (a database, a JSON object, or simply a CSV file), and use them from the form:

    https://cff.dwbooster.com/blog/2019/02/14/ds

    This alternative allows you to update the Google Sheets document; the form will use the new data without editing it.

    Best regards.

    Thread Starter benlashley80

    (@benlashley80)

    Im not sure I can do that on my own but it definitely sounds way better. Thank you for the tip and I will give it a try!

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @benlashley80

    The process is straightforward, but assembling the dataset is a tedious and repetitive task.

    Best regards.

    Thread Starter benlashley80

    (@benlashley80)

    ok this works great with the dropdowns, is there a way to make it work with radio buttons?

    *edit – after i wrote this i realized all I needed to do was change the calculated form to calculate the feild name of the radio buttons and it works the same there. Thanks again for the advice!!

    • This reply was modified 1 year, 2 months ago by benlashley80.
    Plugin Author CodePeople2

    (@codepeople2)

    Excellent !!!

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘multiple options form’ is closed to new replies.