Hi, Is it possible, to sort a Ref Enumlist of...

(Jan Beyer) #1

Hi, Is it possible, to sort a Ref Enumlist of locations by distances?

I’ve tried =Orberby(Distance(Here(),(RefTable[RefColumn],[Coordinates]),false) but it is’nt working.

Can someone help me,to get the formula right?

(Praveen Seshadri (AppSheet)) #2

OrderBy only works with a list of refs.

You need something like this:

OrderBy(RefTabl[RefColumn], DistanceVC, false)

And in that table, define the distance VC to be

=Distance(HERE(), [Coordinates])

My concern with this though is that you will expect the virtual column to be “live” — ie recomputed in real time as your location changes. However, that is not the way AppSheet works today. The virtual columns are only recomputed when you sync. This was done to minimize computation (and conserve battery life) on the device, but in a use-case like yours, it is going to lead to stale values.

@Adam_Stone_AppSheet FYI