# Freshdesk Portal

{% hint style="warning" %}
You must be an admin for both Freshdesk and Screendesk to complete this setup.
{% endhint %}

Adding a Screendesk button to your Freshdesk portal enables customers to share screen recordings directly through the help center form when they reach out. This setup eliminates the need to request recordings separately, saving time and reducing back-and-forth communication, which streamlines the support process and improves response efficiency.

### Step-by-Step Guide to Adding a Screendesk Button

1. **Access the Freshdesk Portals Settings**
   * Go to the [Portals section in Freshdesk settings](https://screendesk-helpdesk.freshdesk.com/a/admin/portals): Admin > search for "Portals"
2. **Edit Your Portal Appearance**
   * Click on **Edit** next to your desired portal.
   * Navigate to the **Appearance** section.
   * Click on **Edit Theme** to modify the portal’s layout and settings.

     <figure><img src="https://3820804400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfW6XSzJSKsNyZnOkSJPt%2Fuploads%2FdOSqG45DRenj44DIsYFm%2FScreenshot%202024-10-20%20at%2015.28.14.png?alt=media&#x26;token=ce843053-8fff-4d99-b932-88946dadca2c" alt=""><figcaption></figcaption></figure>
3. **Open the Pages Tab**
   * Select the **Pages** tab within the theme editor.

     <figure><img src="https://3820804400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfW6XSzJSKsNyZnOkSJPt%2Fuploads%2FKecjlESsKfq7mdHijnZz%2FScreenshot%202024-10-20%20at%2015.33.20.png?alt=media&#x26;token=c6b515b1-9561-4048-a08c-afe97b9c74f1" alt=""><figcaption></figcaption></figure>
4. **Edit the Layout Page**
   * In the **Layout** section, click on the **Layout** page to access the HTML editor.
5. **Get the Screendesk Code Snippet**
   * Open Screendesk in a new tab and go to **Account settings > Integrations > Freshdesk > Configure** via [this link](https://app.screendesk.io/integrations).
   * Copy the code snippet provided.
6. **Paste the Code Snippet into the Layout Page**

   * Return to the **Layout** page in Freshdesk.
   * Paste the Screendesk code snippet just below `{{footer}}` in the HTML editor.
   * Make sure to update the[ query selectors](#how-to-find-the-query-selectors) in the code snippet.

   ```markup
    // Initialize the screendesk recorder with the form fields.
       // The first parameter is the query selector of the field on which we will pass url of the recording.
       // The second parameter is the query selector of the field on which we will check for the email.
       window.initializeScreendesk("#description", "#email");
   ```
7. **Publish the Changes**
   * Click on **Publish** to save your changes.
   * Your Screendesk button is now live on the Freshdesk portal.

### How to find the query selectors

To find the ID of the email and description input fields on the Freshdesk portal, follow these steps:

1. Open your Freshdesk portal in a web browser.
2. &#x20;Right-click on the email input field and select "Inspect" or "Inspect Element" from the context menu.
3. In the developer tools that appear, look for the HTML code of the input field. The ID will be listed as an attribute, typically something like id="email\_address".
4. Repeat the process for the description field, right-clicking and inspecting it to find its ID in the HTML.&#x20;
5. Make sure to append # to the email and description ids when updating the code snippet. E.g: **email\_field becomes #email\_field**.

### Preview Your Portal

After publishing, preview your Freshdesk portal to ensure that the Screendesk button appears as expected and is functioning properly.
