# Lookup function returning error: Error trying to coerce 'FS4253' to a number

**URL:** <https://forum.inductiveautomation.com/t/lookup-function-returning-error-error-trying-to-coerce-fs4253-to-a-number/43406>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 15, 2021, 8:12am UTC](https://forum.inductiveautomation.com/t/lookup-function-returning-error-error-trying-to-coerce-fs4253-to-a-number/43406 "2021-02-15T08:12:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 15, 2021, 8:12am UTC](https://forum.inductiveautomation.com/t/lookup-function-returning-error-error-trying-to-coerce-fs4253-to-a-number/43406/1 "2021-02-15T08:12:36Z")

</div>

8.1.0

I have a dataset and i’m trying to use `lookup` to lookup a value in the `Value` column. It’s finding it, but for some reason it’s trying to return it as an integer?

Expression within a transform (hardcoded values for testing; value is bound to the dataset):  
`lookup({value}, 4151, -1, 'Value', 'Label')`

Dataset:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/0/00e1de65273b20446b564009322a2ab0b048d8c6.png)

```auto
"#NAMES"
"Value","Label"
"#TYPES"
"I","str"
"#ROWS","24"
"4151","FS4151"
"4152","FS4152"
"4153","FS4153"
"4154","FS4154"
"4155","FS4155"
"4156","FS4156"
"4157","FS4157"
"4158","FS4158"
"4159","FS4159"
"4160","FS4160"
"4161","FS4161"
"4162","FS4162"
"4175","FS4175"
"4176","FS4176"
"4177","FS4177"
"4178","FS4178"
"4179","FS4179"
"4180","FS4180"
"4181","FS4181"
"4182","FS4182"
"4183","FS4183"
"4184","FS4184"
"4185","FS4185"
"4186","FS4186"

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cbb081da3a985642238689da7cb3a093da002c2b.png)

Looks like a bug to me?  
I’ve tried the reverse (lookup the Label) and this works correctly and returns the Value. Not useful for me though

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [February 15, 2021, 10:45am UTC](https://forum.inductiveautomation.com/t/lookup-function-returning-error-error-trying-to-coerce-fs4253-to-a-number/43406/2 "2021-02-15T10:45:01Z")

</div>

Try changing the default value (-1) to a string ("-1").

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 15, 2021, 10:47am UTC](https://forum.inductiveautomation.com/t/lookup-function-returning-error-error-trying-to-coerce-fs4253-to-a-number/43406/3 "2021-02-15T10:47:02Z")

</div>

Yep that was it, cheers! I’ve seen that before as well. Must be lack of sleep 😴
