# SharinPix Form - Context Parameters

## Overview

**Context Parameters** allow you to pass custom values to a SharinPix Form when it is launched. These parameters become available throughout the form and can be used in formulas to control behavior, customize content, and adapt the form to different use cases.

This documentation covers:

* [What are Context Parameters](#what-are-context-parameters)
* [Passing Context Parameters](#passing-context-parameters)
* [Using Context Parameters in Formulas](#using-context-parameters-in-formulas)

{% hint style="warning" %}
**Prerequisites:**

* A SharinPix Form Template should already be created. Refer to the [SharinPix Form Template Editor documentation](https://docs.sharinpix.com/forms/form-elements/sharinpix-form-template-editor).
* Basic understanding of [SharinPix Form Formulas](https://docs.sharinpix.com/forms/form-elements/sharinpix-form-formula-functions-and-operators).
  {% endhint %}

## What are Context Parameters

Context parameters are key-value pairs passed to the form via the URL when launching it. Once passed, these values become available throughout the form and can be accessed using the <mark style="color:red;">`form.params object`</mark>.

Example: If you launch a form with <mark style="color:red;">`&context=inspection`</mark> in the URL, you can access this value anywhere in the form using <mark style="color:red;">`form.params.context`</mark>. This returns "inspection".

## Passing Context Parameters

Context parameters are passed as URL query parameters when launching the form.

### URL Format

**Universal Link:**

```
https://app.sharinpix.com/native_app/form?token=<your_form_token>&<param_name>=<value>
```

**Deeplink:**

```
sharinpix://form?token=<your_form_token>&<param_name>=<value>
```

## Using Context Parameters in Formulas

Below are usage examples of **Context Parameters** in **Formulas** for a dynamic **SharinPix Form**.

### Conditional Visibility

Show different form sections based on the context

#### Visibility Formula:

```
form.params.context = "inspection"
```

This makes the element visible only when context=inspection is passed in the URL.

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fgit-blob-250c5b9305d97075b0a276a4ee9404645ca82eaf%2FDOC%20SF%20-%201920%20x%201080%20\(12\).png?alt=media)

#### Example URL:

```
https://app.sharinpix.com/native_app/form?token=<your_form_token>&context=inspection
```

The form launches with the inspection section. The section was not visible on the editor since the **Context Parameter** was not present there.

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fgit-blob-8ee01255ece44ab987528856fd50803bb2ae8227%2FDOC%20Mobile%20-%201920%20x%201080%20\(4\).png?alt=media)

**Use Case**

Create a single form template that adapts to different scenarios:

* context=inspection → Shows inspector-related fields
* context=customer → Shows customer-related fields

### Dynamic Default Values

#### Pre-populate fields with values from the URL:

```
form.params.stage
```

When launched with \&stage=Initial, the field defaults to "Initial".

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fgit-blob-c1b092b994615cb8b1f09aac194852a2f6904f86%2FDOC%20SF%20-%201920%20x%201080%20\(15\).png?alt=media)

**Example URL:**

```
https://app.sharinpix.com/native_app/form?token=<your_form_token>&stage=Initial
```

The image below shows the form launched with the **Context Parameter** <mark style="color:red;">`stage=Initial`</mark>.

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fgit-blob-2dc5dbf2b980ffe2d4c130e495e094b16c7cc96c%2FDOC%20Mobile%20-%201920%20x%201080%20\(6\).png?alt=media)
