# Help writing lookup formula

**URL:** <https://community.weweb.io/t/help-writing-lookup-formula/3681>\
**Category:** How do I?\
**Tags:** formulas, binding\
**Created:** [July 26, 2023, 3:53pm UTC](https://community.weweb.io/t/help-writing-lookup-formula/3681 "2023-07-26T15:53:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpb1987](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mpb1987](https://community.weweb.io/u/mpb1987)\
**Post date:** [July 26, 2023, 3:53pm UTC](https://community.weweb.io/t/help-writing-lookup-formula/3681/1 "2023-07-26T15:53:04Z")

</div>

Hi all! Generally new to WeWeb and struggling a bit with a formula.

I have a Collection called “userDetails”. On the page I’m working on, I know the value for “userDetails.data.name”. I’d like to do a lookup to get the value for “userDetails.data.id”.

I feel like somehow either “lookup” or “lookuparray” and maybe “getkeyvalue” are involved, but I can’t seem to get the right formula. I also tried the AI Formula Generator and it didn’t provide anything that worked.

Any ideas please? 🙂  
Thanks!  
Matt

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [July 26, 2023, 4:01pm UTC](https://community.weweb.io/t/help-writing-lookup-formula/3681/2 "2023-07-26T16:01:20Z")

</div>

getKeyValue( lookup( yourValueForName, userDetails), “id”)
