Question on if/then values

Hey all,

Working on putting together an app to estimate build hours when quoting a build on an emergency vehicle. One option that has me a bit hung up is the hour calculations per task. Basically you’ll see drop down boxes to select options for the vehicle and in the bottom right there will be a running tally of hours estimated. Essentially I want to assign a specific set of hours per option selected and have it add them up in the bottom right corner.

Any recommendations on setting this up to calculate the hours?

Thanks all!

This depends a little bit on your database structure (as if you already have a lot of things set up it might not be worth it to change everything) but if not then this would be how I would do it.

The best way to populate the dropdown is with an option set. The option set name should be the category of things. The option set should have a Display (the default field provided) but also another attribute that of type number that is the amount of time associated with the given thing. The time should be in hours since your end output is the total hours. See below:

Then populate the dropdowns and make each one correspond to each option set.

Then add a group around the text box that is displaying the hour total. Make this group of type number. Make the text inside the group’s data source be parent group’s number. Then set the data source of the parent group equal to Dropdown 1 (or whatever yours is called)'s values’s time + Dropdown 2’s values’s time + … Dropdown n’s values’s time. This will dynamically update the total based on the value of the dropdowns.

Screenshot 2023-09-27 at 10.22.25 PM

Hope this helps,
Aanya

This topic was automatically closed after 70 days. New replies are no longer allowed.