# Validate location

As the name suggests, this condition is used to validate the active location of the user filling the form against a pre defined Geo-Fence. Learn more about <mark style="color:purple;">**Geo-Fence Field**</mark>

### What is the use case?

Whenever you want users to not submit the form if the active location is outside a predefined Geo-Fence area. Let's understand this with an example.&#x20;

#### Attendance use case

* A project is being conducted on ground. A geo-fence area is defined at the project location.
* Now the On-field construction workers come to work and they need to mark their attendance at the project location.&#x20;
* If the active location of the user is outside the defined geo-fence then the attendance shouldn't be marked and a proper message is shown to the user

This can be achieved using **Validate location.**&#x20;

### **Over which type of field is it applied?**

The user creating the form applies this condition over a location type of field.

<figure><img src="/files/6byT5LuqMZezyiCfaLhT" alt=""><figcaption></figcaption></figure>

The user clicks on **Select Fields** to get list of all location type of fields that exists in the form being created.

### How do I set the area for validation of location?

The area for validation is set using the **Geofence** type of field. The user sets the area perimeter using the [<mark style="color:purple;">Geofence field</mark>](https://docs.senpiper.com/form-builder/creating-forms/additional-form-settings/conditions/pages/-MlTKz6Y8xUCmZEa9lxP#10.-geo-fence).

<figure><img src="/files/XqQBn7T89TABRcZMbGUl" alt=""><figcaption></figcaption></figure>

### How do I set this up?

Let's understand it in steps:

1. Create a **Project details** form for recording the details of the project and set this form as a [<mark style="color:purple;">master form</mark>](broken://pages/VJNjCQOW7EE1svCBtIUC#what-are-master-forms-and-sub-forms).
2. In the **Project details** for&#x6D;**,** create a [<mark style="color:purple;">Geofence fiel</mark>](https://docs.senpiper.com/form-builder/creating-forms/additional-form-settings/conditions/pages/-MlTKz6Y8xUCmZEa9lxP#10.-geo-fence)<mark style="color:purple;">d.</mark>
3. Create a submission with Construction site perimeter as a value for the Geofence field in the **Project details** for&#x6D;**.**
4. Create another form **Attendance** form with the Geofence field and a location field in it along with other required fields and [<mark style="color:purple;">set the Project details</mark> <mark style="color:purple;"></mark><mark style="color:purple;">**form**</mark> <mark style="color:purple;"></mark><mark style="color:purple;">as a master form</mark>](broken://pages/VJNjCQOW7EE1svCBtIUC) to the **Attendance** form.
5. [<mark style="color:purple;">Map</mark>](/form-builder/creating-forms/additional-form-settings/conditions/conditional-values-of-fields/master-mapping.md) the Geofence field of **Attendance** form with the Geofence field of the **Project details** form.&#x20;
6. While creating the submission for the **Attendance** for&#x6D;**,** the Geofence field of **Attendance** form will have the Geo fence field value which is there in the submission created for the **Project details form** ([<mark style="color:purple;">this form being the master form and geofence fields are mapped</mark>](/form-builder/creating-forms/adding-fields-and-saving-a-form/creating-master-records.md)).
7. In the **Attendance** form, now we can set the condition **Validate location** on the location field and use the Geo fence field for deciding the area to be considered for location validation.

<figure><img src="/files/0I79GgfLOasowLbZkUiZ" alt=""><figcaption></figcaption></figure>

In the above image,&#x20;

1. **Location** is the field over which **Validate location logic** will be applied. So by our example, Location field of **Attendance form** will be this field.
2. **Copied Geo fence is the** Geofence field with which the location has to be validated. In our example, it is the Geo fence field of the **Attendance form** whose value is mapped with the Geo fence field of the **Project details** form.&#x20;
3. Error message that should be shown to the user filling up the form in case the location validation fails.

### Can I allow the user to submit the form even if the location validation fails?

Yes you can. While setting up the condition, **Validate location** the user can choose to allow the user filling up the form to create successful submission even if the validation fails.

<figure><img src="/files/eyNuxnuHasfjtKVduxmn" alt=""><figcaption></figcaption></figure>

> The user can set some condition as well to implement **Validate location** using [<mark style="color:purple;">Enter validation condition</mark>](/form-builder/creating-forms/additional-form-settings/conditions/append-values-to-a-field.md#what-is-the-use-case) input box shown in the below image.
>
> The user has to give the **error message** that should be shown in case the validation fails.

<figure><img src="/files/uUsfNe4jMyr0PpjJWlE6" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.senpiper.com/form-builder/creating-forms/additional-form-settings/conditions/validate-location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
