# Advanced search\_criteria usage

**URL:** <https://community.gravityforms.com/t/advanced-search-criteria-usage/2404>\
**Category:** Get Help\
**Tags:** custom, gfapi, search-criteria, entry-meta\
**Created:** [August 5, 2019, 11:01pm UTC](https://community.gravityforms.com/t/advanced-search-criteria-usage/2404 "2019-08-05T23:01:24Z")\
**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:** [August 5, 2019, 11:01pm UTC](https://community.gravityforms.com/t/advanced-search-criteria-usage/2404/1 "2019-08-05T23:01:24Z")

</div>

Hey there,  
So I’m doing an AJAX that populates data from a selected past entry. All that works dandy. I was just hoping to kick it to the next level. My code is working fine, I’m just hoping for some direction on the best way to make use of the `$search_criteria` array.

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

```

Right now the documentation is lacking, but let;s say I want to look up an entry by a certain field in the entry. Would that be:

```
$search_criteria = array(
     '2' => 'Boom',
),

```

Thanks!

---

<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:** [August 6, 2019, 6:58pm UTC](https://community.gravityforms.com/t/advanced-search-criteria-usage/2404/2 "2019-08-06T18:58:40Z")

</div>

So here is an example. I can’t seem to get:

```
$search_criteria = array(
	'created_by' => 1,
),

```

To work properly. But I can get:

```
$search_criteria = array(
	'status' => 'active',
),

```

To work fine. Its a bit annoying.

What am I missing?

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 4, 2022, 5:21pm UTC](https://community.gravityforms.com/t/advanced-search-criteria-usage/2404/3 "2022-01-04T17:21:47Z")

</div>

Closed on January 4, 2022, 5:21pm UTC


