Hide UX Views based on distance of the user

akash1
New Member

Hi, I have a table named “Geofence” It has a column Coordinates which has Longitude and Latitude Coordinates. I have added a virtual column named “Distance” with formula “DISTANCE(HERE(),[Coordinates])”

Now What I want to do is hide all UX views if the distance between any of the coordinate and users location is less than 1KM.

How can I do that? I tried various formulas but those are not working, One which is very close to what I want to do is pasted below.

Show If Constraint in UX Views:

IF(
“Geofence”[_Distance]<1,
“true”,
“false”
)

Please Help

Solved Solved
0 7 288
  • UX
1 ACCEPTED SOLUTION

Maybe try this?

MIN( Geofence[_Distance] ) < 1 )

That’s assuming DISTANCE() outputs in kilometers, which I have no idea if it does or not. Also, the app will need to sync for these distance columns to recalculate based on current position.

View solution in original post

7 REPLIES 7

Maybe try this?

MIN( Geofence[_Distance] ) < 1 )

That’s assuming DISTANCE() outputs in kilometers, which I have no idea if it does or not. Also, the app will need to sync for these distance columns to recalculate based on current position.

DISTANCE() returns kilometers.

It is giving an error
"Unable to find column DISTANCE

On Google Sheets
Coordinates are saved in following format

22.674384, 75.879777

Looks like your column is named “Distance”, not “_Distance”. Is that the issue?

Thanks, You were right.

But now getting a new error

“This formula is not evaluated in the context of a row, so column values are not available.”

That’s not an error. It’s just an informative message about what sort of expression you can write in that spot. This expressions conforms to the constraint.

It worked, thanks a lot.

Top Labels in this Space