In a dispatch app I have a table of Drivers (including each Driver’s geographic address), and a table of Jobs (including each Job’s Pickup address).
At some point (triggered by a button for example) the user needs to pick the n (maybe 6) nearest available drivers to the Job’s address.
So I want to end up with a Repeating Group listing Driver ID ordered/sorted by Distance.
I can see 2 approaches:
-
In the Current Job: create a list of Driver IDs and a list of Distance for each Driver; use a private plug-in to sort the first list by the second; then display this sorted list along with a check box to allow multiple selections. But how do I display the list? An RG doesn’t seem to lend itself to showing a list of values with a check box against each one.
-
For each Driver create a single field called Distance. This can then be easily displayed in an RG, ordered by Distance (the ordering being a feature of the RG). But how do I create/modify a single field for all Drivers?
Both approaches seem to have a hurdle that I can’t jump yet!
Any ideas welcomed!
The screen shot below shows Driver ID (column GW) and Distance for a particular Job - but obviously this is not sorted by distance!