Tips to improve my prototype app

Dividing by 80.5 wouldn’t be a viable solution. It might work for some numbers, but with rounding it would bite you in other places. That’s where I mentioned I was stuck with the decimal form of the mileage and chains. At the time I couldn’t come of with a way to mathematically convert the total back to miles and chains within glide and you would need to use forumulas in the sheet and then split the mileage and chains on the decimal so you could calculate the decimal separately back to chains…but I have an idea that might work. It’s a little messy, but it keeps everything with glide.

Assuming you already have the total figured out in the decimal format, here’s what I came up with. It’s a little weird because of how glide handles a math column with precision set (not sure if this is a bug, but its been mentioned here: Ugly Date in If-then-else). The underlying value doesn’t show the values as a whole number, so I had to create a template column to fully convert the math column into a whole number to be used to calculate the chains separately. (Confused yet?)
image

  • The first total column is the total you have already calculated with the mileage + (chains/80) formula.
  • The second column is a math column with precision set to a whole number so we can separate the mileage from the chains.
  • The third column is a template column to make sure the math column is fully converted to a whole number (This feels like a glide bug that I shouldn’t have to do). Otherwise I couldn’t subtract the whole number from the total to separate out the chains decimal value.
    image
  • The forth column is a math column that subracts the mileage template column whole number from the total to give us only the decimal value. This is then multiplied by 80 to convert the decimal value back to chains as a whole number. (Technically this converted back to 2.4 chains, but with rounding as a whole number it gives us 2 which is what I think you are looking for.)
  • At this point you have the 2 separate mileage and chains columns if you choose to display them separately, but the 5th column is there to demonstrate that you can use a template to display the mileage and chains as a decimal by joining the 2 values with a decimal point in between, or you could write it out in sentence format like this: “You traveled xxx miles and yyy chains”. I think the sentence format would make more sense to the user. A simpler format could be “xxx miles | yyy chains”. It’s all up to you.
    image

For you second issue with the checkboxes, do you want the Travelled In checkboxes to be clickable or would they only be set from the haulage form? I would maybe consider a similar setup to the haulage checkbox where you would use an if/then column to determine which emoji to display instead. What I would do is create a template column on your unit sheet that would join the signed in user’s email from the user profile and the unit number together. Create the same template on the haulage sheet, but with the unit and email submitted from the form. Then, using the template columns, create a relation column to link the unit sheet to the haulage sheet template column. The relation will return something only when the signed in user has the matching unit and email in the haulage sheet. Then based on that, you can create an if/then column, which would return a checkbox :white_check_mark: if the relation is not empty, else return :white_large_square: if the relation returns nothing. You can display this emoji checkbox in your unit list details by itself, or use a template to join it to the unit number and display that template in the list instead.

2 Likes