# Lookup with multiple lookup values

**URL:** <https://forum.inductiveautomation.com/t/lookup-with-multiple-lookup-values/11558>\
**Category:** Ignition\
**Created:** [April 22, 2016, 3:47am UTC](https://forum.inductiveautomation.com/t/lookup-with-multiple-lookup-values/11558 "2016-04-22T03:47:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qversa](https://avatars.discourse-cdn.com/v4/letter/q/35a633/32.png) [@qversa](https://forum.inductiveautomation.com/u/qversa)\
**Post date:** [April 22, 2016, 3:47am UTC](https://forum.inductiveautomation.com/t/lookup-with-multiple-lookup-values/11558/1 "2016-04-22T03:47:53Z")

</div>

Is it possible to use the lookup function with more than one lookup value? I have a DataSet with six columns. I would like to return the value of one column based on a lookup value match in two other columns. Based on the lookup function parameters this does not seem possible.

Is there a better way to do this? I would like to use a DataSet instead of a database table for this because it is critical and can’t rely on a database server connection always being up.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 22, 2016, 11:22am UTC](https://forum.inductiveautomation.com/t/lookup-with-multiple-lookup-values/11558/2 "2016-04-22T11:22:35Z")

</div>

No, lookup() cannot do this. You could use the view() function from [Simulation Aids](http://marketplace.inductiveautomation.com/moduledetail?moduleId=93) like this:

```auto
try(
  view('Select resultcolumnname Where col1==args[0] and col2==args[1]',
    {Root Container.SourceDataset},
    {Root Container.Col1MatchValue},
    {Root Container.Col2MatchValue})[0,0],
  fallbackValueOrReference)

```

view() returns a dataset with any rows that meet your criteria. The [0,0] picks the first match, or fails if no match at all. The failure is caught by try(), which then gives the fallback.
