> For the complete documentation index, see [llms.txt](https://docs.wem.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wem.io/platform/wemreference/functions/lists/rowid.md).

# RowId

{% hint style="info" %}
The **`RowId()`** function returns the ID of the current row of a list.

Any database list also has a numeric \[ID] field which holds the numeric primary key value for each row and gets automatically incremented on each add new row action. When you use that ID field in your expressions, you will see it in the form `[12345: ID]`, which does not make it immediately clear which field (or rather, which list) you are pointing to. Other fields use the Technical Name in expressions, which helps to understand where they are coming from. When using the RowId(list) function in expressions, you will see immediately to which list you are referring, so this makes it far more usable.

A RowId of a List-item has multiple forms:&#x20;

* directly displaying in a label, will use the ToString() version, and yields the combined identifying information for the List and the Row;
* with the ToNumber() function, it will yield the numeric id value - same as the numeric \[ID] field;

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

{% hint style="success" %}
The Row ID value of one of the following:

* The current row of a list (when using the List as parameter)
* The referenced row of a reference field (when using a reference field as parameter)
  {% endhint %}

### Syntax

<details>

<summary><code>RowId(</code><mark style="color:blue;"><code>list</code></mark><code>)</code></summary>

`RowId( [Users] )`\
\&#xNAN;*=> n196761\_2000000001 {for a new row not yet saved}*

`RowId( [Products] )`\
\&#xNAN;*=> i1428100\_2614 as string, when item with id 2614 is the current row*\
\&#xNAN;*=> 2614 as numeric*

</details>

<details>

<summary><code>RowId(</code><mark style="color:blue;"><code>reference</code></mark><code>)</code></summary>

`RowId( [CurrentProduct-Reference] )`\
\&#xNAN;*=> i1428100\_2614 as string, when item with id 2614 is the referenced item*\
\&#xNAN;*=> 2614 as numeric*

`RowId( [ClearedProduct-Reference] )`\
\&#xNAN;*=> unknown - reference is empty, not pointing to a specific row*

</details>

### Parameters

<table><thead><tr><th width="150">Name</th><th width="150">Type</th><th width="150" align="center">Required</th><th width="248.15953250810662">Description</th><th data-hidden>Required?</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>list</code></mark></td><td>List</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2611">☑️</span></td><td>a list from the data-model </td><td>yes</td></tr><tr><td><mark style="color:blue;"><code>reference</code></mark></td><td>reference field</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2611">☑️</span></td><td>a reference field</td><td></td></tr></tbody></table>


---

# 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 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/lists/rowid.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.
