<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSManagedObjectModel/fetchRequestTemplate(forName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSManagedObjectModel(im)fetchRequestTemplateForName:"
  },
  "title" : "fetchRequestTemplate(forName:)"
}
-->

# fetchRequestTemplate(forName:)

Returns the fetch request with a specified name.

```
func fetchRequestTemplate(forName name: String) -> NSFetchRequest<any NSFetchRequestResult>?
```

## Parameters

`name`

A string containing the name of a fetch request template.

## Return Value

The fetch request named `name`.

## Discussion

If the template contains substitution variables, you should instead use [`fetchRequestFromTemplate(withName:substitutionVariables:)`](/documentation/CoreData/NSManagedObjectModel/fetchRequestFromTemplate(withName:substitutionVariables:)) to create a new fetch request.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)