---
lang: en
title: 'API docs: repository.entitycrudrepository.findbyid'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.entitycrudrepository.findbyid.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [EntityCrudRepository](./repository.entitycrudrepository.md) &gt; [findById](./repository.entitycrudrepository.findbyid.md)

## EntityCrudRepository.findById() method

Find an entity by id, return a rejected promise if not found.

<b>Signature:</b>

```typescript
findById(id: ID, filter?: Filter<T>, options?: Options): Promise<T & Relations>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  id | <code>ID</code> | Value for the entity id |
|  filter | <code>Filter&lt;T&gt;</code> | Additional query options. E.g. <code>filter.include</code> configures which related models to fetch as part of the database query (or queries). |
|  options | <code>Options</code> | Options for the operations |

<b>Returns:</b>

`Promise<T & Relations>`

A promise of an entity found for the id


