Show badge depending on the selection in another table

Hello everyone, I have the following challenge.
I have 4 tables

  1. Customers
  2. Vehicles
  3. Tires
  4. Tire tread depth

If the tire tread depth is below 4mm, a picture with a warning symbol is displayed, if the tire tread depth is over 4mm, a green tick is displayed.

The challenge for me now is that I want to change the images depending on the profile depth of the tires (which belong to a customer) at the customer so that the customer image changes if only 1 tire is below the 4mm mark, otherwise it should the green hoe will be visible.

So I imagine something with MAX values ​​but I don’t know how I can do it in glide or google sheet, then it is dynamic which and how many tires belong to the customer, does anyone know?

Yes you could do that using Computed Columns in Glide. You could find the Max using a Rollup Column but it sounds like you actually want to find the Min? Both Max and Min can be calculated using the rollup column. Then use an If-Then-Else column to decide when to show your warning/ green check.

i.e. if Min tread is less than 4mm then show warning else green check.

yes it would work if, then, else, but how do I manage it across multiple tables, since the badge in customer has to change through a min value in the profile tables?

It’s kinda difficult to visualise what you mean - can you give a couple of screenshots of the affected data tables and point out the relevant columns? (from the Glide Data Editor, not from the Google Sheets)

1 Like

So the app has

  1. Customers
  2. Associated vehicles
  3. and tires belonging to the vehicles

The tires are stored at the garage.

If the tires have a minimum tread depth of 4mm, this is marked with a warning symbol.

if one tire of the entire tire set is not good, then the entire tire set is marked with a warning symbol.

I’ve got this far, as soon as all tires are ok, the symbol for the tire set is changed, as soon as even one tire is not good, the symbol is changed for the entire tire set, it fits that way.

I would also like to have such a visible control on the customer screen,

So if a tire, which is about the vehicle that belongs to the customer, is not good, then the customer’s badge should change.

the stars are linked to the rating, which can be given to the customer, 1 to 3.

I have created a mockup of how it should look if only one of the customer’s tires (assigned via vehicles) should be faulty.

In this way, the user can see immediately on the customer screen whether a tire in the portfolio is not ok and can then maneuver through vehicles to the tire hotel for the tire.

I was actually asking for screen shots from the Glide Data Editor, but anyway…

Customers relate to Vehicles, and Vehicles relate to Tyres, yes?

I would imagine that you there for have a multi relation that joins one customer to zero or more vehicles, and another multi relation that joins one vehicle to zero or more tyres.

Let’s say in your Tyres table you have a boolean column:

  • If tread depth is less than 4mm then true (true means the tyre is bad)
  • In your Vehicles table, you can get a count of “bad” tyres for each vehicle by doing a rollup through your Tyres relation column, counting the number of “true” values from the above
  • You can then mark each vehicle as either “good” or “bad” by examining this count. ie. if the count is greater than zero then the vehicle has at least one bad tyre
  • Then use that to determine what a customer sees when he views that vehicle

That might not be exactly what you need (because you didn’t show your data), but it should give you the general idea.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.