# QueryCurrentRow

Returns the current row number

## Method Signature

```
QueryCurrentRow(query=[query])
```

### Arguments

| Argument | Type    | Required | Description                                  | Default |
| -------- | ------- | -------- | -------------------------------------------- | ------- |
| `query`  | `query` | `true`   | The query to get the current row number from |         |

## Examples

### Simple QueryCurrentRow Example

Here we've example to get the currentRow number.

```java
<bx:set myQuery = queryNew( "id,name", "integer,varchar", [ 
	[
		1,
		"Rajesh"
		],
	[
		2,
		"Anil"
		]
	] ) >
<bx:loop query="myQuery">
	<bx:if name == "Anil" >
		<bx:output>#queryCurrentRow( myQuery )#</bx:output>
	</bx:if>
</bx:loop>
```

Result: 2

### Simple currentRow Example

Here we've example to get the currentRow number from query using script syntax.

```java
<bx:script>
	var myQuery = queryNew( "id,title", "integer,varchar", [
		[
			1,
			"Charlottes Web"
		],
		[
			3,
			"The Outsiders"
		],
		[
			4,
			"Mieko and the Fifth Treasure"
		]
	] );
	bx:loop query="myQuery" {
		if( title == "Mieko and the Fifth Treasure" ) {
			writeOutput( myQuery.currentRow() );
		}
	}
</bx:script>

```

Result: 3

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJwljrEOwjAMROf4KyxPrZS1Q0GdYGFB6sJSdQhgQQVJi0lUIsS%2Fk7TLDc9357OxlYgNtoElHnkukIardsYyaaSD83xj0Scju7uRhDoE1YFSda2T0tsSqF6vrKoWZh%2BZQY%2FlFs6fzXMcJ3zl%2BoZs%2Fkb4BTXL4Hkf7FSst0sQYedlTAsWF5Y5%2F4M%2FB6Itlg%3D%3D)

```java
myQry = QueryNew( "id,name", "Integer,VarChar", [ 
	[
		99,
		"sm"
	],
	[
		55,
		"mk"
	]
] );
bx:loop query="myQry" {
	writeDump( querycurrentrow( myQry ) );
}

```

## Related

* [QueryAddColumn](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryaddcolumn)
* [QueryAddRow](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryaddrow)
* [QueryAppend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryappend)
* [QueryClear](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryclear)
* [QueryColumnArray](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumnarray)
* [QueryColumnCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumncount)
* [QueryColumnData](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumndata)
* [QueryColumnExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumnexists)
* [QueryColumnList](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumnlist)
* [QueryDeleteColumn](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querydeletecolumn)
* [QueryDeleteRow](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querydeleterow)
* [QueryEach](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryeach)
* [QueryEvery](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryevery)
* [QueryFilter](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryfilter)
* [QueryGetCell](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querygetcell)
* [QueryGetResult](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querygetresult)
* [QueryInsertAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryinsertat)
* [QueryKeyExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querykeyexists)
* [QueryMap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querymap)
* [QueryNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querynew)
* [QueryNone](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querynone)
* [QueryPrepend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryprepend)
* [QueryRecordCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrecordcount)
* [QueryRecordCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrecordcount)
* [QueryReduce](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryreduce)
* [QueryRegisterFunction](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryregisterfunction)
* [QueryReverse](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryreverse)
* [QueryRowData](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrowdata)
* [QueryRowSwap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrowswap)
* [QuerySetCell](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysetcell)
* [QuerySetRow](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysetrow)
* [QuerySlice](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryslice)
* [QuerySome](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysome)
* [QuerySort](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysort)


---

# 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://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycurrentrow.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.
