I have a choice dropdown that allows the user to select from a list of accessories for their vehicle. The purpose of the form is to get a price estimate on a new vehicle. As such, when they select their accessories I need each of these to have a linked value that can be added to a total at the bottom of the page.
For example, they select a sunroof ($1000), floor mats ($100) and a bull-bar ($500). I want the total displayed at the bottom of the form to reflect the $1600 worth of accessories.
Is there a way to do this without the user clicking a "calculate" button that runs the values? I'd like it to all happen as they select the options if possible, to make it easier to see recalculations.
I created a combobox (cmbAccessories) to replicate something similar to your application.
Then I created a collection on "On Change" of the combobox:
Then I created a label and set the value of it to Sum(colSelectedAccessoriesPrice.Price,Price)
now when I make changes to the combo box, the total gets updated automatically.
hope this helps.
If I helped you with solving the problem, please choose Accept as Solution and give me a Thumbs Up.
The combo box is directly linked to a choice column in the sharepoint list, so I don't think I'm able to assign each choice a second value.
Is there still a way to assign them a value in the form? Or alternatively can I patch the results of a freshly created combobox to the choice column in the list?
There is a separate sharepoint list that contains the vehicle make/model and price, as well as insurance/fuel estimates. Based on which make/model the user selects from a drop down, I have some labels doing LookUp functions to find the value of each of the additional costs.
The combo box linked to the choice column however is all within the one column. In sharepoint it gives me the option to put all of the accessories as values for the choice, with the user able to select multiple.
Possibly a workaround would be to have a list with each accessory and its value, and look those up based on which accessories are selected in the combobox?
yes, definitely you need a Price List for accessories and you need to bind it to your Combo box. I don't know how complicated your use case can get, but you need a List of Accessories that go only with certain type of cars. For example not all cars can have a rear spoiler.
1- You need a Accessories Price List (Required columns : Item, Price)
2- Bind a combo box to the Accessories Price List
3- Patch the combobox selected items to your Estimate List (follow this video)
4-you need a column in your Estimate list for "Total Price of the Accessories" so you patch the total there.
I'm sure you will find a way to handle this quickly.
If my answer solved your problem, please hit Accept As Solution. and If my post was helpful, please give me a Thumbs Up.
Would there be any way I could set it up so that the user could see the total cost change without needing to click a button to patch the results?
For example, using a few hidden labels to calculate values? If I set up a list with the value for each accessory for each vehicle, could I have a label that reflects the values in the combobox? Even if I set up one label for each combobox option (10 or so). Label1 could be "If combobox value is rear spoiler, then 1, else 0", Label2 could be "If combobox value is roof racks then 1, else 0" etc.
Then another 10 labels that would be "If Label1 equals 1, then Lookup "Vehicle Accessory Costs" with vehicle value as specified in a dropdown further up, and the accessory being rear spoiler". 20 labels total in this instance. Most would have a value of 0, and as such not affect the total price.
The final calculation (SUM) field could then just SUM all of the second stage labels.
Could I then use IF statements to determine which accessory price information to patch? IF(Label1 = 1, patch Label1_Price, "").
Or would it be less effort to get rid of the choice column altogether and simply patch a combobox across, and calculate the values from the combobox as it would simply have 2 values for each option?
yes, I'm refering you to my very first reply. the label gets populated automatically without clicking the submit button. users can see the Total price of the accessories in a label.
I wouldn't take that path that you explained, it might work but think about maintaining your application. if you want to make a change in your accessories list then you need to change your app and publish a new one. I'm still voting for a separate nice and clean Price List.
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
Learn how to build the business apps that you need.