---
title: "item(for:request:completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileproviderreplicatedextension/item(for:request:completionhandler:)"
---

# item(for:request:completionHandler:)

Asks the file provider for the metadata of the provided item.

## Declaration

```swift
func item(for identifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, (any Error)?) -> Void) -> Progress
```

## Parameters

- `identifier`: The item’s identifier.
- `request`: An object that identifies the context of that request, such as the requesting app.
- `completionHandler`: A block that you call after downloading the item’s metadata. The block takes the following parameters:

## Return Value

Return Value An item that tracks your extension’s progress. The system automatically calls cancel()  on the progress object when an error occurs.

## Discussion

Discussion If your extension doesn’t recognize the item, pass NSFileProviderError.Code.noSuchItem to the handler. The system assumes the item is no longer in the domain, and attempts to delete the local copy. If the delete attempt fails because the item has local changes, the system reimports the item by calling createItem(basedOn:fields:contents:options:request:completionHandler:). If you pass NSFileProviderError.Code.notAuthenticated or NSFileProviderError.Code.serverUnreachable to the handler, the system presents an appropriate alert to the user, but doesn’t try to access the metadata until triggered again by the user. The system considers any other errors to be transient, and automatically retries the method call.

## See Also

### Accessing Remote Content

- [fetchContents(for:version:request:completionHandler:)](fileprovider/nsfileproviderreplicatedextension/fetchcontents(for:version:request:completionhandler:).md)
