How to assign a user selection to a local variable?

Certified Senior Developer

Hi, I'm needing some direction on how to assign a user selection to a local variable. For some context: There are several drop down selections on my interface. Based on what the user selects in each category will affect the total price. So I'm gathering that I'll need several local variables, one for each drop down selection, and then a total where they are all added up. I just cant seem to figure out how to assign what the user selects to a local variable. Or maybe there's a better way to go about it? Any help would be appreciated. Thanks!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The solution to this ranges from very simple to rather complex. 

    At the "very simple" end, all you need to do is set the component's saveInto: parameter to point at the local variable you want to save the dropdown's value into.  At the same time it's necessary to set its value: parameter to the same local variable (or else the save will execute but then the dropdown will go back to looking "empty", having no value).

    At the "rather complex" end, you can set up a separate local variable to calculate the running sum of any group of other ones.  You can use this directly for display purposes in any other field on your form.

    To be able to help in any real detail, we'll need more context, as well as sample code for what you've tried so far (please use a code box, "Insert" --> "Insert Code").

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    I've been playing around with the local variables and have been able to get the user selections displaying, however (and I think this was my fault in explaining the situation) I need to assign my own amounts to whatever they select. This is a practice application for auto insurance coverage. So if the user selects 25,000 coverage for a specific category, I need to assign my own dollar amount for how much that's going to add to the premium. 

Reply
  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    I've been playing around with the local variables and have been able to get the user selections displaying, however (and I think this was my fault in explaining the situation) I need to assign my own amounts to whatever they select. This is a practice application for auto insurance coverage. So if the user selects 25,000 coverage for a specific category, I need to assign my own dollar amount for how much that's going to add to the premium. 

Children
No Data