# Search custom fields via API

**URL:** <https://integration.keap.com/t/search-custom-fields-via-api/145>\
**Category:** API Q&A\
**Created:** [March 16, 2017, 8:16pm UTC](https://integration.keap.com/t/search-custom-fields-via-api/145 "2017-03-16T20:16:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tzvi\_Anolick](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@Tzvi\_Anolick](https://integration.keap.com/u/Tzvi_Anolick)\
**Post date:** [March 16, 2017, 8:16pm UTC](https://integration.keap.com/t/search-custom-fields-via-api/145/1 "2017-03-16T20:16:22Z")

</div>

I’m trying to use the DataService.findByField API call to search Contacts on a custom field, and it returns ERROR: 10 - [NoFieldFound]No field found:

The problem might be that the field name was defined (not by me) with a space in the name; or it may be that I need to do something else. I should mention that I am an outside developer and have not been given Admin rights to the account, so that makes it more difficult to investigate.

Any suggestions would be greatly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [March 16, 2017, 11:47pm UTC](https://integration.keap.com/t/search-custom-fields-via-api/145/2 "2017-03-16T23:47:52Z")

</div>

Two things. Check the name and make sure it matches the actual database name you can view with the link when you view custom fields. Also when making requests through the api you must precede it with an underscore. You might want to post the code snippet and variable values to make it easier to help.

---

<div class="post-metadata">

**Author:** ![MichaelFairchild](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/michaelfairchild/32/111_2.png) [@MichaelFairchild](https://integration.keap.com/u/MichaelFairchild)\
**Post date:** [March 17, 2017, 2:49am UTC](https://integration.keap.com/t/search-custom-fields-via-api/145/3 "2017-03-17T02:49:05Z")

</div>

I would also recommend using DataService.query as you have additional query operators such as “less than” and “greater than” that are not available with findByField.

---

<div class="post-metadata">

**Author:** ![Tzvi\_Anolick](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@Tzvi\_Anolick](https://integration.keap.com/u/Tzvi_Anolick)\
**Post date:** [March 17, 2017, 1:02pm UTC](https://integration.keap.com/t/search-custom-fields-via-api/145/4 "2017-03-17T13:02:54Z")

</div>

This is the code…$custno is assigned from an input CSV file:  
$returnFields = array(‘Id’);  
$dups = $app-\>dsfind(‘Contact’,1,0,‘Customer ID’, $custno, $returnFields);

If I do the exact same code but search on Last Name or another regular field, it works find, but for Customer ID I get:  
ERROR: 10 - [NoFieldFound]No field found: Contact.Customer ID  
I tried an underscore in front and it didn’t help. I am trying to reach the person who created the custom fields to verify the exact name.

Is there any way to list all the fields in a table from the API? I don’t see it.

Thanks.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [March 17, 2017, 1:43pm UTC](https://integration.keap.com/t/search-custom-fields-via-api/145/5 "2017-03-17T13:43:33Z")

</div>

Goto Admin-\>settings then General-\>custom fields and click ‘Go’ then click the “View the field database names link”. This will give you a list of all custom fields and the names used for them that are in the database. This will be the name you must precede with an underscore.
