# Get Last entry id \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/get-last-entry-id-resolved/2325>\
**Category:** Get Help\
**Tags:** gfapi, entry-id\
**Created:** [July 23, 2019, 9:27pm UTC](https://community.gravityforms.com/t/get-last-entry-id-resolved/2325 "2019-07-23T21:27:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parkbum](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/parkbum/32/810_2.png) [@Parkbum](https://community.gravityforms.com/u/Parkbum)\
**Post date:** [July 23, 2019, 9:27pm UTC](https://community.gravityforms.com/t/get-last-entry-id-resolved/2325/1 "2019-07-23T21:27:12Z")

</div>

Hey there,  
Anyone have any thoughts on how to dig up the last entry\_id from a certain form? I’m fairly sure I can do it through SQL, but if there is a way through API, then it is a little unclear:

```
$entries = GFAPI::get_entries(
	$form_id, 
	$search_criteria = array(), 
	$sorting = array(
		'key' => 'date_created',
		'direction' => 'ASC'
	),
	$paging = array(
		'offset' => 0, 
		'page_size' => 100
	), 
	$total_count = null
	
);

```

Thoughts?

---

<div class="post-metadata">

**Author:** ![Parkbum](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/parkbum/32/810_2.png) [@Parkbum](https://community.gravityforms.com/u/Parkbum)\
**Post date:** [July 23, 2019, 10:23pm UTC](https://community.gravityforms.com/t/get-last-entry-id-resolved/2325/2 "2019-07-23T22:23:21Z")

</div>

Never mind, set it to:

```
	$entries = GFAPI::get_entries(
	$form_id, 
	$search_criteria = array(), 
	$sorting = array(
		'key' => 'date_created',
		'direction' => 'DESC'
	),
	$paging = array(
		'offset' => 0,
		'page_size' => 1
	), 
	$total_count = null
	
);

```

And it seems to be okay.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [July 24, 2019, 9:15pm UTC](https://community.gravityforms.com/t/get-last-entry-id-resolved/2325/3 "2019-07-24T21:15:49Z")

</div>

Closed on July 24, 2019, 9:15pm UTC


