# RequestCollectionElementCallback Function

> Callback function for getNext() requests executed on collections. Receives the result via two parameters, the first one being the element itself (or null if the end of the collection has been reached) and the second one indicating that the call was successful.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Function
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > RequestCollectionElementCallback Function
- **240 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestcollectionelementcallback/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestcollectionelementcallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestcollectionelementcallback/llms-full.txt

---

### Description

Callback function for getNext() requests executed on collections. Receives the result via two parameters, the first one being the element itself (or null if the end of the collection has been reached) and the second one indicating that the call was successful.

### Syntax

```javascript
function(<object> element, <boolean> moved)
```

### Examples

The following example demonstrates `RequestCollectionElementCallback` in a practical document-editing workflow. Callback function for getNext() requests executed on collections. Receives the result via two parameters, the first one being the element itself (or null if the end of the collection has been reached) and the second one indicating that the call was successful.

```javascript
function requestCollectionElementCallback(element, moved) {
    console.log("Callback values:", { element, moved });
}
```

---

## Nearby

- **Previous:** [RequestCheckFormFieldCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestcheckformfieldcallback/llms-full.txt)
- **Next:** [RequestColorStringCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestcolorstringcallback/llms-full.txt)
