Getting an alert when a certain number is reached

Hi Commu,

I’m scratching my head on a problem those days, that some of you might be able to solve.

I’m building an App for a car management company.

What i want to acheive, is making alerts to pop up every 10.000km the car is making (like it’s time for a revision).

So the drivers or employes enter the vehicule KM each time that they take it, the Data field is a classic number atm.

Any suggestions to make the alert each time a certain number is reached i the field?

Thanks! :slight_smile:

Hi @clement4,

You can use a database trigger for this

2 Likes

Hi @johnny thanks a lot for your reply, indeed, database triggers seems to be the way to do it.

Now, there is an other concern, basically, on a car, the revision happens every 10.000 Km and the car can go let’s say to 500.000 Km.

Witch makes 50 different alerts to set if you go 10K per 10K. Is it a way in your opinion to just make it happen every 10k instead of set it individually?

The condition on the trigger on the Car/Vehicle data type should be:

Car before’s Mileage / 10000:floor < Car now’s Mileage / 10000:floor

That essentially puts each 10,000 km into a unit and returns yes when the car before the change was below a 10,000 km threshold, and the car now is above a 10,000 threshold.

2 Likes

Hi @georgecollier, thanks a lot mate, I haven’t tried it yet, but sure it works. Before i start implementing, I have one last concern.

Sometimes, the vehicle revision will happen a bit late. Let’s say on the first one, they do it at 12.000 instead of 10.000.

So instead of having it dumbly just every 10k regardless of what they really do, i need the alert to be displayed 10.000 from the last revision.

How would you structure things in the App?

→ Like a new field in Vehicle called “Last revision” (type: number) that captures the vehicle Km when you click a button

→ Then what conditions would you go for on the trigger?

Thanks for your help :slight_smile:

I don’t know what you mean, but the trigger I showed above will run every time the car’s mileage is changed such that it crosses a 10,000km boundary.

What I mean @georgecollier is that the calculation has to be in between 2 different metrics.

  • Miles - on one hand
  • Last revision - on the other

I don’t want the alert to be displayed every 10.000 Miles, i want the alert to be displayed 10.000 Miles after the last revision, depending on the car’s growing mileage.

So basically, there is the “Car Miles” witch is growing with time, but the “Last Revision field” is not.

So how to trigger the alert 10.000 km after the Last Revision, but depending on the Mileage?

(If you still struggle to understand, i can go through the workflows and explain deeper).

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