If your business bills by increments of 15 minutes, there are a few workarounds for automating this for your users.
Table of Contents
Solution Using an Increment Field
Solution Using Reference Data
Format the Reference Data File
Although this solution requires some setup in Google Sheets or Excel, it is the simplest solution of the two. First, we need to establish the essential basics of why this solution works. There are limited field types that accept Reference Data. Although we are calculating with time, we cannot power a Time field with reference data. Therefore, we need to convert integers to their time equivalent in the reference data. That will look something like this:
The spreadsheet above establishes that the Parent Field is a drop down menu containing the three potential options for fifteen (15) minute increments. The field that will auto-populate based on the option in the drop down will be a number purely used in the calculation and therefore can be "hidden" to reduce confusion on the mobile side.
Translated to integers:
- 15 minutes is 25% of an hour, i.e. 0.25,
- 30 minutes is 50% of an hour, i.e. 0.50,
- 45 minutes is 75% of an hour, i.e. 0.75.
Upload the Reference Data File
Now that the reference data file is created, it needs to be uploaded to the GoCanvas portal and those instructions can be found in the Help Center article, "Upload a Google Sheet as Reference Data" or "Uploading Reference Data when using the Builder."
Setup the Form Fields
Next, we need to setup the fields in the form.
- Navigate to the Forms page and edit an existing form or Create New: Mobile Form.
- Locate the Screen where these fields will go or Add Screen.
- Add a Number field, either with click to add, drag and drop, or click Add Field to use Smart Fields. This should be a Number field in the style of Number that does not allow decimals. This will be where the user will input the number of hours they worked as an integer.
- The second field will be a Single Choice field in the style of Drop Down. This will be the field where the user selects 15, 30, or 45 minutes, if needed.
- While the drop down field is still highlighted, expand Reference Data in the Settings panel on the left. For a refresher on mapping fields, please refer to the Help Center article, "Map Reference Data to your Fields in the Builder."
- The first drop down, Reference Data File will be the file we just made and uploaded. In this example, the file is called, "Calculate Time in Increments of 15 Minutes."
- The Reference Column in our example will be the "Drop Down" column. The Parent Field only requires these two drop down menus so this field is complete.
- The third field will be another number field in the style of number, but needs to allow for 2 decimal places. Expand the Advanced menu, click the Decimal Places drop down and select 2 and toggle Mobile Visible off.
- While the number field is still highlighted, expand Reference Data.
- The Reference Data File will be the same file as above,
- The Reference Column will be "Hidden Number,"
- The Reference Screen will be the screen where the parent field is located,
- The Reference Field will be the parent field.
- The final field will be a Calculation field in the format of HH:MM.
- Expand Calculation in the left Settings panel. The first drop down will be the first number field, where the user inputs the amount of hours worked,
- Leave the function as + (addition).
- The second drop down will be the "Hidden Number."
This solution is now complete. Below is how the fields look in the center workspace for this example but it is encouraged to label your fields in the way that makes the most sense for your users.
And here is what these fields will look like on mobile:
Solution Using an Increment Field
This solution is more interactive for users but the setup is slightly more complicated and requires more explanation on the screen for the user so they understand how to interact with the fields accurately. The entire solution can be done from within the GoCanvas Builder, so there is less switching tabs required of the person building the form.
- Navigate to the Forms page and edit an existing form or Create New: Mobile Form.
- Locate the Screen where these fields will go or Add Screen.
- Add a Number field, either with click to add, drag and drop, or click Add Field to use Smart Fields. This should be a Number field in the style of Number that does not allow decimals. This will be where the user will input the number of hours they worked as an integer.
- The second field is a number field in the style of Increment. Set the Maximum to 3, equal to the amount of options we had above: 15 minutes, 30 minutes, and 45 minutes.
- The third field is a Static Text field where we can clarify how to use the Increment field. The text of this field needs to explain how to use the Increment field above. Note, the second and third fields can be flipped, if the admin prefers the instructions for the Increment field to be before the field itself. Flipping these two fields will not affect functionality.
- Fields four, five, and six are the numbers that will be used in the calculation, since the Increment field does not equate to the numbers necessary for the calculation. Add three Time fields in the style of MM:SS. For ease of building, one field can be setup then copied twice. Make sure to return to each copied field to update the Custom Time and Condition Value for the second and third fields, as those are the only settings that will differ.
- The first time field will represent 15 minutes. Change the Default setting to Custom Time and add "15:00" to the Custom Time setting.
- Expand Conditions and click Add Condition. Expand the Field drop down, select the screen where the Increment field is located and then the name of the Increment field. The Condition is = (Equal) and the Value is 1.
- Expand Advanced and toggle Mobile Visible off.
- The second time field will represent 30 minutes. Change the Default setting to Custom Time and add "30:00" to the Custom Time setting.
- Expand Conditions and click Add Condition. Expand the Field drop down, select the screen where the Increment field is located and then the name of the Increment field. The Condition is = (Equal) and the Value is 2.
- Expand Advanced and toggle Mobile Visible off.
- The third time field will represent 45 minutes. Change the Default setting to Custom Time and add "45:00" to the Custom Time setting.
- Expand Conditions and click Add Condition. Expand the Field drop down, select the screen where the Increment field is located and then the name of the Increment field. The Condition is = (Equal) and the Value is 3.
- Expand Advanced and toggle Mobile Visible off.
- Here is what the settings will look like for the field representing 15 minutes, the other two will look similar save for the Custom Time and the Condition Value as mentioned above.
- The first time field will represent 15 minutes. Change the Default setting to Custom Time and add "15:00" to the Custom Time setting.
- The final field will be a Calculation field in the format of HH:MM.
- Expand Calculation in the left Settings panel.
- The first drop down will be the first number field, where the user inputs the amount of hours worked,
- Leave the function as + (addition).
- The second drop down will be the 15 minute field.
- Click Add Value and leave the function as + (addition).
- The third drop down will be the 30 minute field.
- Click Add Value and leave the function as + (addition).
- The fourth drop down will be the 45 minute field.
- Remember that all potential options must be included in this calculation for this solution to work but only the number triggered by the condition will be ultimately included in the final calculated time.
- Expand Calculation in the left Settings panel.
This solution is now complete. Below is how the fields look in the center workspace for this example but it is encouraged to label your fields in the way that makes the most sense for your users.
And here is what these fields will look like on mobile:
Did we answer your question?
We'd really appreciate your feedback! Please leave your suggestions for improvement in the comments or let us know what you're looking for so we can assist you better. We want to help, but we need to understand your needs!
Comments
0 commentsPlease sign in to leave a comment.