# Prefill form fields

Its possible to prefill the form using special paramters in the URL , then send the URL to customer, so they will have the fields prefileld for them

Query string can be added to the URL to prefill fields, it have the following form

```
https://mymart.miproductcares.com/forms/product-registration?sn=123&purchaseDate=2023-08-08

```

In the above url, anything after ? is called query string and it will be a key and value pair

e.g&#x20;

**sn=123**

Its possible to add multiple query strings to the url using **&**

e.g

**sn=123\&purchaseDate=2023-08-08**

The above url will prefill the serial number and purchase date field in the form

### Prefill Product field

The product field is a special field, because it contain more information then simple title, it will have to contain id, so it can match the product on the backend

So the query string for prefill product is a product id

e.g&#x20;

product=product\_id\_12323

```
https://mymart.miproductcares.com/forms//product-registration?product=product_id_12323
```

The above will prefill the product field, Please use a valid product id, otherwise it won't work

The product id can be found by going to the product in the admin > Products > Product detail, then look at the URL, it should be the id in the last part of the URL

### Prefill other fields

Its possible to prefill any fields on the from, but first you will have to find out the name of the field, normally the name can be found in the App admin > Forms > Select the form > Design > Select the field > Field options will show the field name (on the right hand side)

![](/files/zZtPZ1M4mDKTHP1c6EUG)

Once you find out the field name, then you can use the above pattern to add the field name to the URL

e.g&#x20;

**purchaseDate=2023-08-08**

Make sure the value is correct format - specially for date

### Test the URL

Once the prefill URL is devised

**Test the URL and make sure it worked before send to customer**


---

# 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.productcares.com/frontend-page/prefill-form-fields.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.
