> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query.md).

# Query

With query actions you can investigate the contents of inventory items, such as users, assets, groups or domains. You can run these DoControl query actions on your data:

* [Data scan](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md) - Scan text-based files and Slack Enterprise messages for classifiers or regex patterns.
* [PII file scan](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/pii-scan.md) - Scan text-based files for PII (personally identifiable information).
* [Regex scan](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/regex-scan.md) - Scan text-based files for regular expression patterns and strings.
* [Get identity](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/get-identity.md) - Retrieve a user's full identity profile including both personal and risk exposure data.
* [Get file metadata](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/get-file-metadata.md) - Return all the metadata of a file in Google Drive, including [Google labels](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/get-file-metadata.md#leverage-google-drive-labels-in-workflows).
* [Get files by hash](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/get-files-by-hash.md) - Retrieve a list of Google Drive asset IDs by a matching file hash value.
* [HRIS: Get user metadata](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/hris-get-user-metadata.md) - Retrieve user metadata from HRIS apps, such as BambooHR, Deel HR, Workday, SAP SuccessFactors and HiBob, based on a specific user's email.

According to the output of the query actions; for example, if a file is hidden or has PII information, you can add other actions, including remediation steps.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FAIxdeGMcD2zuucGnUu6H%2FMar-23-2022%2014-06-15.gif?alt=media&amp;token=4f54e79b-46c9-497a-94bc-acae225d7ff0" alt=""><figcaption></figcaption></figure>

## To run a PII scan or Regex scan?

The decision to run a PII file scan or Regex scan depends on the nature of your search items, and your expected results. The main differences between a PII scan and Regex scan are as follows:

<table><thead><tr><th width="131.33333333333331">Parameter</th><th>PII scan</th><th>Regex scan</th></tr></thead><tbody><tr><td>Search item</td><td>A fuzzy, non-exact name, such as <code>address</code> or <code>password</code>.</td><td>An exact name, such as, <code>5th Avenue</code> or <code>pw1234!</code></td></tr><tr><td>Limitation</td><td>You can search for a limited set of up to 33 search items (predefined labels).</td><td>No limitation on number or type of items. You can search for any custom expression.</td></tr><tr><td>Result</td><td>Probability, or a percentage that an exact match was found.</td><td>If found, the exact match with its location in the file.</td></tr></tbody></table>

### **PII scan**

A PII scan uses an external probability engine to detect the probability that a file includes predefined labels. You can search for a limited set (up to 33) of predefined labels. You need a file with a critical mass of data to initiate a PII scan. Files which contain a small amount of text data might result in inaccurate results or false findings.

**We recommend you use a PII scan** when you're not 100% sure about the spelling of the search items. For example, if you're looking for any password that varies between possible patterns, it's best to use an engine that will give you a probability estimate you can rely on.

### **Regex scan**

A Regex scan uses a deterministic scanning algorithm to detect a specific expression, string or pattern in a file. If you accurately configure a regular expression, the Regex scan will find any relevant results in the file and display them in the step output.&#x20;

**We recommend you use a Regex scan** when you know the textual structure, or pattern, of the keywords you are looking for and would like to view clear, unequivocal results. Alternatively, use a Regex scan when you're looking for proprietary sensitive information that is not considered as personally identifiable information (PII). This could include sensitive internal company items, budget data, or unique customer data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
