# Dynamic Tag Values

Dynamic tag values allow you to populate tag values automatically based on window data such as titles, URLs, or extracted identifiers. This removes the need for predefined or hard-coded tags and enables more accurate, real-time visualization of how users interact with documents and applications.

This capability is especially useful for customers who work extensively with documents such as Excel, Word, or PDFs, where file names frequently change. Dynamic tags ensure that document names appear exactly as users see them, across dashboards and views.

Dynamic tag values work consistently across **Process View**, **Business Apps**, and **Data Transfer** views, and apply to all document types and application screens.

***

### **How Dynamic Tag Values Work**

Dynamic tags use variable syntax (`${...}`) to reference runtime data collected from application windows.

#### **Example Configuration**

```json
{
  "key": "content-category",
  "value": "${title}"
}
```

With this configuration, a window titled:

```
Purchase Orders 07/25.xlsx
```

Produces the following tag value:

```json
{
  "key": "content-category",
  "value": "Purchase Orders 07/25.xlsx"
}
```

***

### **Supported Dynamic Variables**

Dynamic tag values support the following variables:

* `${title}`
* `${title_lower}`
* `${active_process_name}`
* `${url}`
* `${extract_identifiers.<identifier_name>}`

These variables resolve automatically based on the captured window event.

***

### **How to Configure Dynamic Tag Values**

#### **Step 1: Add or Edit an Application Rule**

1. Add an application (for example, **Microsoft Excel**).
2. Set the process name (for example, `excel.exe`).
3. Open the application-level rule.
4. Click the **pen icon** to edit the rule as code.

***

#### **Step 2: Add a Dynamic Tag**

Locate the existing `tags` list:

```json
"tags": [
  { "key": "appname", "value": "Microsoft Excel" }
]
```

Add a new dynamic tag, for example:

```json
[
  { "key": "appname", "value": "Microsoft Excel" },
  { "key": "content-category", "value": "${title}" }
]
```

✅ **Result:**\
All window titles are captured dynamically and displayed as window names across dashboards and views.

***

### **Capturing Only Part of a Title or URL**

Dynamic tags can also capture **specific parts** of a window title or URL using **regular expressions** and **extracted identifiers**.

***

#### **Example 1: Capture Only a GitHub Pull Request Number**

**Typical window title:**

```
Fix bug process data fetching bug by jannekavander-workfellow · Pull Request #160 · ProcessMaker/sluice
```

**Goal:** Capture only `Pull Request #160`.

**Step 1: Create an Extracted Identifier**

```json
"extract_identifiers": [
  {
    "id": "d0d501ed-1da2-457e-84bd-b08d5627a020",
    "identifier_name": "github_pr_number",
    "regex_pattern": "(Pull\\s+Request\\s*#\\d+)",
    "from_fields": ["title"]
  }
]
```

**Notes:**

* Generate a random UUID4 for the `id`.
* Use underscores in `identifier_name`.
* Choose the correct `from_fields` value (`title` or `url`).

***

**Step 2: Reference the Identifier in Tags**

```json
[
  { "key": "appname", "value": "Github" },
  {
    "key": "content-category",
    "value": "${extract_identifiers.github_pr_number}"
  }
]
```

✅ **Result:**\
The window name displays only the Pull Request number.

***

#### **Example 2: Capture Only the Path from Jira URLs**

**Typical Jira URLs:**

```
https://processmaker.atlassian.net/browse/FOUR-16248
https://processmaker.atlassian.net/jira/software/c/projects/FOUR/boards/714
```

**Goal:** Capture only the path after `atlassian.net/`.

**Steps**

1. Edit the Jira application rule.
2. Add a new `extract_identifiers` entry:
   * Generated UUID
   * Regex pattern that extracts the URL path
   * `from_fields`: `["url"]`
3. Reference the identifier in the tags list:

```json
{
  "key": "content-category",
  "value": "${extract_identifiers.<your_identifier_name>}"
}
```

4. Save the configuration.

✅ **Result:**\
The window name displays only the relevant Jira path.


---

# 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://processmaker.gitbook.io/process-intelligence/data-collection/dynamic-tag-values.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.
