# PortalId

{% hint style="info" %}
The **`PortalId()`**&#x66;unction gets the id of the current portal.

This function can be used to enable or disable certain features for a specific portal.

This function is SQL compatible. For more information about SQL compatibility, see our [documentation](/platform/wemreference/sql-compatibility.md).
{% endhint %}

{% hint style="success" %}
Returns the Id as number of the current portal id.
{% endhint %}

### Syntax

<details>

<summary><code>PortalId()</code></summary>

`PortalId()`\
\&#xNAN;*=>* 34372

`PortalId() = 34372`\
\&#xNAN;*=> Yes*

</details>


---

# 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.wem.io/platform/wemreference/functions/environment/portalid.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.
