# User Grid - Deployment Process

GridMate offers two deployment options for User Grids: a graphical interface through the **Admin Cockpit** and [**SF CLI Plugin**](/tools/sf-cli-plugin.md). The scenario in this tutorial is to create Accounts and Contacts User Grids and move them from org to another. User Grids exported in Salesforce metadata like format (JSON), can be easily modified using popular tools like VS Code before importing them back.

## Prerequisites

### Enable GridMate Advanced User&#x20;

* Go to setup, and on the quick find Box search for Users.
* Click on the desired **Full Name.**
* Click on Permission Set Assignments.

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

* Click on permission set assignments.

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

* Click on edit assignments.

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

* Enable **GridMate Advanced User**.

<figure><img src="/files/9bCOP2ApEceiweFgcC0W" alt=""><figcaption></figcaption></figure>

### Enable GridMate Cockpit User&#x20;

* Go to setup, and on the quick find Box search for Permission Sets.
* Click on the **GridMate Cockpit User**.

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

* Click **Manage Assignments**.

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

* Ensure the existence of desired user, if not, click **Add Assignment** to add it.

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

### SF Cli Plugin Setup

* Clone the repository.

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

```
git clone https://github.com/GridMate/gridmate-sf-plugin
```

* Go to the plugin directory and Install npm modules.

<figure><img src="/files/3qFjfvKdZZ0uM4j8GXG0" alt=""><figcaption></figcaption></figure>

```
npm install
```

* Link the plugin to your cli installation.

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

```
sf plugins link .
```

## User Grids Setup

We are now ready to start using the **GridMate User Grid** to create **Accounts** and **Contacts** Grids.

### Accounts User Grid

* On the App Launcher search for **GM - User Grids**.

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

* Click New.

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

* Create Accounts User Grid:
  * Object Name: **Account**
  * List View: **All Accounts**
  * Grid Name: **Accounts**

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

### Contacts User Grid

* Create Contacts User Grid:
  * Object Name: **Contact**
  * List View: **All Contacts**&#x20;
  * Grid Name: **Contacts**

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

### Inline Component Setup

* Go to **Config Wizard** on the **Accounts** User Grid.

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

* Select the **inline Components** tab.
* User Grid : **Contacts**.
* Condition :&#x20;

  ```json
  {
      "and": [
          {
              "AccountId": {
                  "operator": "=",
                  "value": "$recordId"
              }
          }
      ]
  }
  ```

<figure><img src="/files/1ZtsQS3NKWbSBq5tRZD9" alt=""><figcaption></figcaption></figure>

## User Grids Deployment

### Deployment Using **Admin Cockpit.**

The Accounts and Contacts User Grids are created and the inline component is also configured, we can start the Deployment using **Admin Cockpit**.

#### User Grids Export

* On the App Launcher search for the **GM - Admin Cockpit**.

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

* Select the **User Grid Maintenance.**
* Select the the **Accounts** and **Contacts** User Grids.
* Click **Export** to export them.

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

* Open the **Accounts** User Grid using **Visual Studio Code** for example:

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

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

* Change the Owner **Username** to the match the target org.

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

* Open the the **Contacts** User Grid using **Visual Studio Code**.

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

<figure><img src="/files/9HyZNh1QW9fUMy6cFKF0" alt=""><figcaption></figcaption></figure>

* Change the Owner **Username** to the match the target org.

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

#### User Grids Import

* Moving to the target org (Demo 13 in our example).
* Import the **Accounts** and **Contacts** User Grids using the **GM-Admin Cockpit**

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

* First import the **Contacts** User Grid. Inline grids should be always imported first to be able to link them when parent grids are imported.

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

* Second import the Account User Grid.

<figure><img src="/files/4jIILn9LMZ0FIYOrPRD9" alt=""><figcaption></figcaption></figure>

### Deployment Using CLI Plugin

After completing the [SF Cli Plugin Setup](#sf-cli-plugin-setup), we can now **Export/import** the User Grids.

#### User Grids Export

* Export the User Grid Using [SF Cli Plugin](/tools/sf-cli-plugin.md)

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

```
sf gmpkg usergrid export -o gmpkg-demo10 --api-version=58.0 -d "/Users/otmanetakhif/Desktop/WorkSpace/TrialForce/gridmate-demo/Downloaded" -n "Contact_nr9ma,Account_kozsu"
```

#### User Grids Import

* Change the Owner of the User Grids as explained in [Deployment Using Admin Cockpit](#deployment-using-admin-cockpit.)
* Import the **Contacts** User Grid  Using [SF Cli Plugin](/tools/sf-cli-plugin.md)&#x20;

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

```
sf gmpkg usergrid import -o demoOrg13 --api-version=58.0 -f "/Users/otmanetakhif/Desktop/WorkSpace/TrialForce/gridmate-demo/Downloaded/Contact_nr9ma.json"  
```

* Import the Account User Grid  Using [SF Cli Plugin](/tools/sf-cli-plugin.md)&#x20;

<figure><img src="/files/3MixCVe7w3GGtvHsrZBk" alt=""><figcaption></figcaption></figure>

```
sf gmpkg usergrid import -o demoOrg13 --api-version=58.0 -f "/Users/otmanetakhif/Desktop/WorkSpace/TrialForce/gridmate-demo/Downloaded/Account_kozsu.json"
```

## Final Result

Using either the **Admin Cockpit** or the **SF CLI Plugin** to obtain the desired results, On our target org (**Demo** **13**), locate the **Accounts** User Grid and **Contacts** Grid as an **inline component**.

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

<figure><img src="/files/xaHwehiVa2yMJVGFN50i" 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.gridmate.io/advanced-guides/user-grid-deployment-process.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.
