Bonus Exercise 1.1: Create the Calculations
- Navigate back to your App Home screen if you are not currently on it, then click the Travel request table to open table builder
- Click the Forms button to get to form builder
- Click Add a field in the table
- In the pop-up, enter Travel days in Column label, and change Type to Integer. Leave the auto-populated field under Column name
- Click Add
- Click Add another one
- Enter Estimated trip cost in Column label, and change Type to Decimal. Leave the auto-populated field under Column name
- Click Add
- Click Done
- You should notice now on the left sidebar two form elements highlighted with a purple left border. These are your new fields you added
- Drag and drop the Travel days and Estimated trip cost form elements onto your form
- Click Save
- Click the Travel days form element
- On the rightside bar, you should see the options change
- Click Formula
- Click Add
In the pop-up Formula box, enter the following formula:
TIMEDIFF(return_date,departure_date)
- Click Submit
- On the top right, click Save
- Click Estimated trip cost
- Click Formula, then Add
In the pop-up Formula box, enter the following formula:
SUM(estimated_airfare,MULTIPLY(travel_days, 150))
info
Our formula here takes into account that each travel day, the employee is given $150 per diem
- Click Submit
- On the top right, click Save