# Struggling with a simple formula

**URL:** <https://community.weweb.io/t/struggling-with-a-simple-formula/4374>\
**Category:** Ask us anything\
**Created:** [September 15, 2023, 9:07pm UTC](https://community.weweb.io/t/struggling-with-a-simple-formula/4374 "2023-09-15T21:07:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Pederson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mark_pederson/32/14758_2.png) [@Mark\_Pederson](https://community.weweb.io/u/Mark_Pederson)\
**Post date:** [September 15, 2023, 9:07pm UTC](https://community.weweb.io/t/struggling-with-a-simple-formula/4374/1 "2023-09-15T21:07:05Z")

</div>

So, I’ve been doing well learning away on formulas with the help of co-pilot - but I am banging my head on one - that should be very simple lookup and probably very common but no matter what I do I keep getting errors.

I am trying to get the **ID** from a **Collection** (table in Xano) where my **Variable** exists in a **specificField**.

My last (failed) attempt was:  
getKeyValue (lookup ( **Variable** , **Collection** , ' **specificField’** ) , ‘id’)

error = “Fist parameter must be an object”

Any help most appreciated - co-pilot has been crushing formulas for me - but for some reason I can’t get this simple one to work.

---

<div class="post-metadata">

**Author:** ![AJAW](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@AJAW](https://community.weweb.io/u/AJAW)\
**Post date:** [September 16, 2023, 4:42pm UTC](https://community.weweb.io/t/struggling-with-a-simple-formula/4374/2 "2023-09-16T16:42:48Z")

</div>

I think this formula will help [Array Formulas | WeWeb documentation](https://docs.weweb.io/formulas/array.html#filterbykey)

```auto
filterByKey(collection, "key", "value")

```

That will return an array so you can just add `[0]` at the end to get the first item.
