# Activate location automatically or required

**URL:** https://community.glideapps.com/t/activate-location-automatically-or-required/77264
**Category:** Ask for Help
**Created:** [October 23, 2024, 1:44am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264 "2024-10-23T01:44:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 1:44am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/1 "2024-10-23T01:44:30Z")

</div>

hi, I’m trying to make an attendance application, is there a way to enable location automatically, or at least required?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/8/38befcf702339977a76d51bc0df4a0af43de1c79.jpeg)

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [October 23, 2024, 2:02am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/2 "2024-10-23T02:02:16Z")

</div>

Learn how to hack this @agung_taufik1

> [@Exploring the Enhanced Capabilities of Glide's Native Form](https://community.glideapps.com/t/exploring-the-enhanced-capabilities-of-glides-native-form/69876):
>
> I want to share about the additional capabilities that we can achieve with Glide’s native form. What I have tested with the help of CSS is that native forms can also be applied for validation. Create your validation in the table columns and present it through messages via the “hint” component. Add the visibility conditional and the class “prevent-submit” to these hint components. Add the following CSS code: /\*Container Form\*/ #page-root:has(.prevent-submi…

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 3:20am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/3 "2024-10-23T03:20:39Z")

</div>

thanks for the info…  
because of the free version, I can’t apply CSS yet

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [October 23, 2024, 3:25am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/4 "2024-10-23T03:25:58Z")

</div>

Another way is that you use a custom form with a custom action to control your submit button.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [October 23, 2024, 4:52am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/5 "2024-10-23T04:52:14Z")

</div>

Just curious - what is the purpose of capturing the location upon check in?

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 5:10am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/6 "2024-10-23T05:10:55Z")

</div>

because this is an attendance application, I want every employee who comes in to be in the office area…  
and I’m developing it, if the employee who comes in is within 1km of the office, that can’t be done

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 5:11am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/7 "2024-10-23T05:11:56Z")

</div>

> [@Himaladin](#):
>
> custom form

I’ll try…thanks

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [October 23, 2024, 5:45am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/8 "2024-10-23T05:45:14Z")

</div>

Okay, that’s what I thought.  
So I assume you have the coordinates of the Office location?  
Assuming yes, add a Distance to Location column that compares the users current location with the Office location. Then you can only allow them to Check in if that distance is less than the threshold that you set, and there is no need to ask for their location in the form. As long as the users allow location sharing when the App is opened, that will work.

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 5:52am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/9 "2024-10-23T05:52:15Z")

</div>

> [@Darren\_Murphy](#):
>
> Distance to Location

oh great, thanks for the idea

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 5:55am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/10 "2024-10-23T05:55:22Z")

</div>

May I ask again, how do I apply Excel formulas in GT? I wrote today but what appears is numbers

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/8/b84d4f4b3f2f45643dc280e1ac06aa565cc71eb8.png)

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [October 23, 2024, 6:08am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/11 "2024-10-23T06:08:01Z")

</div>

If you just want a column containing the current date, you should use a Math column:

 ![CleanShot 2024-10-23 at 14.07.08@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/1/8172800858271b3c59aab86b54d2c6ff7ae5d8dd.png)

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 6:26am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/12 "2024-10-23T06:26:33Z")

</div>

ok thank you very much…  
Can this date reference make the visibility of the check in button disappear?  
For example, today I was absent from coming in and absent from going home, when I was absent from going home, the button will disappear, and will be available again the next day…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/1/f11c9b652d922fa82a55759ace8bec4574d48643.jpeg)

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [October 23, 2024, 6:41am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/13 "2024-10-23T06:41:30Z")

</div>

It’s possible, it’s just a matter of clearly defining the rules, and then building the logic.

Questions:

- do users also Check Out, or do they only Check In?
- if they also Check Out, do you update the existing (Check in) row, or create a new one?

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 6:55am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/14 "2024-10-23T06:55:29Z")

</div>

> [@Darren\_Murphy](#):
>
> - do users also Check Out, or do they only Check In?
> - if they also Check Out, do you update the existing (Check in) row, or create a new one?

1. The user checks out
2. yes… I updated the existing check in line (row)

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [October 23, 2024, 7:08am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/15 "2024-10-23T07:08:27Z")

</div>

Okay.

So if a user Checks in on one day and then forgets to Check out, what should happen on the next day? Do you just forget about the previous day and leave the Check out empty?

Let’s assume yes. I would do something like this…

First, in your Check ins table I would have 3 columns for dates:

- Check In (Datetime column)
- Check Out (Datetime column)
- Date (Number column in the format YYYYMMDD)
- I also assume you have a column to store the users email address

Now in the table that the Check In/Check Out screen is attached to, create the following columns:

- Math column to return the current date in YYYYMMDD format:

```auto
Year(Now)*10^4
+Month(Now)*10^2
+Day(Now)

```

- Query column that targets the Check In table, with the following filters:  
– Email is signed in user  
– Date equals This row-\>math column
- Lookup column that fetches the first check out time via the query column
- Single Value-\>First-\>Whole row column via the query column

To decide if a user needs to check in or check out, use an if-then-else column:

- If Query column is empty, then Check In
- If Lookup column is empty, then Check Out

When a user Checks In, you will always add a new row.  
When a user Checks Out, you will update the existing row via the Single Value column

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 23, 2024, 8:22am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/16 "2024-10-23T08:22:23Z")

</div>

wow great, thanks for the perfect explanation, I’ll try, I’ll ask for your advice again if I encounter any difficulties

---

<div class="post-metadata">

### Author: ![agung\_taufik1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik1/32/80541_2.png) [@agung\_taufik1](https://community.glideapps.com/u/agung_taufik1)
#### Post date: [October 24, 2024, 1:19am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/17 "2024-10-24T01:19:18Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/a/ba2025397061b614803e1355c824728f4f77bc77.png)

> [@Darren\_Murphy](#):
>
> add a Distance

Is there a limit to calculating distance in the free package?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [October 24, 2024, 1:22am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/18 "2024-10-24T01:22:31Z")

</div>

I would think it should be fine as long as you are using coordinates. An easy test would be to add more than 10 rows.

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [October 24, 2024, 4:11am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/19 "2024-10-24T04:11:36Z")

</div>

Use JavaScript to calculate the distance without being affected by this limitation. However, I’m not sure yet if there are any restrictions when using the location button in the free plan.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [October 31, 2024, 4:12am UTC](https://community.glideapps.com/t/activate-location-automatically-or-required/77264/20 "2024-10-31T04:12:31Z")

</div>

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