# How can I use a lookup value in an action

**URL:** <https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988>\
**Category:** Ask for Help\
**Created:** [November 21, 2023, 5:28am UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988 "2023-11-21T05:28:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamMartin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/adammartin/32/66650_2.png) [@AdamMartin](https://community.glideapps.com/u/AdamMartin)\
**Post date:** [November 21, 2023, 5:28am UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/1 "2023-11-21T05:28:51Z")

</div>

How can I use a lookup value in an action. At the moment the column I need is not available in the list of columns when trying to set values of a table. I guess I need to create a new column that is derived from the lookup column somehow. But not having luck with anything I try. I am trying to use the ‘temp/PIN’ column:

 ![Screen Shot 2023-11-21 at 6.25.25 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5d78e107f971583d817df7bf95690c3e93e183bf.png)  
 ![Screen Shot 2023-11-21 at 6.26.06 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/d/1da2be7a144929c65554afcd76cff520b48e3ebf.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 21, 2023, 5:30am UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/2 "2023-11-21T05:30:52Z")

</div>

Change the relation to a single relation so that the lookup column changes from an array to a single value.

---

<div class="post-metadata">

**Author:** ![AdamMartin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/adammartin/32/66650_2.png) [@AdamMartin](https://community.glideapps.com/u/AdamMartin)\
**Post date:** [November 21, 2023, 5:38am UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/3 "2023-11-21T05:38:37Z")

</div>

I am using SV. What is happening is that a new row(in employee table) is being created that automatically creates a random PIN. I need to be able to retrieve that PIN to then store into the users table.  
So not sure how I can change the relation to a single relation and be able to retrieve the last row.

 ![Screen Shot 2023-11-21 at 6.34.35 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/1/71f1002b4730f3ff68594de5c925581fee822add.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 21, 2023, 5:48am UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/4 "2023-11-21T05:48:05Z")

</div>

So the lookup column is retrieving the single value Last Pin directly from the temp table without using a relation? Why not replace the lookup column with a single value column that does the same thing as your existing single value column?

---

<div class="post-metadata">

**Author:** ![AdamMartin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/adammartin/32/66650_2.png) [@AdamMartin](https://community.glideapps.com/u/AdamMartin)\
**Post date:** [November 21, 2023, 6:14am UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/5 "2023-11-21T06:14:09Z")

</div>

Thanks that works… after I resolved a bug with adding a new row from the actions… is it a known bug that you have to have at least one column with a value you can set for adding a new row? It was a simple fix of adding a dummy column that I just set with “temp” text.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 21, 2023, 12:41pm UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/7 "2023-11-21T12:41:51Z")

</div>

> [@AdamMartin](#):
>
> is it a known bug that you have to have at least one column with a value you can set for adding a new row?

Are you saying that you were trying to add a completely empty row?

---

<div class="post-metadata">

**Author:** ![AdamMartin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/adammartin/32/66650_2.png) [@AdamMartin](https://community.glideapps.com/u/AdamMartin)\
**Post date:** [November 21, 2023, 6:57pm UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/8 "2023-11-21T18:57:43Z")

</div>

No. I have a row that has some generated columns… a row can be added fine from the data directly - but in the action - you need to have at least one column that requires manual input.

My table is a bunch of lookups, calculations etc. There is one column which is rand - which means there is at a minimum a value in that column when the row is added.

It was an easy fix of simply adding a column where I simply add a static value from within the action. But of course it introduces an extra column - and makes it susceptible to being accidently deleted and causing issues… as a traditional coder - I like “clean” code. 🙂

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 21, 2023, 7:07pm UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/9 "2023-11-21T19:07:49Z")

</div>

Yeah, that might be your only option. Typically when adding a row, you’re adding something, so I suppose Glide prevents adding if you aren’t adding setting any column values in that add function.

---

<div class="post-metadata">

**Author:** ![AdamMartin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/adammartin/32/66650_2.png) [@AdamMartin](https://community.glideapps.com/u/AdamMartin)\
**Post date:** [November 21, 2023, 7:14pm UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/10 "2023-11-21T19:14:37Z")

</div>

Yeah… not a biggie… I will just come up with a naming convention to ensure that I know not to ever delete it 🙂

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 21, 2023, 7:22pm UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/11 "2023-11-21T19:22:50Z")

</div>

“DO NOT DELETE” is a pretty effective column name. 😉

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [November 28, 2023, 7:23pm UTC](https://community.glideapps.com/t/how-can-i-use-a-lookup-value-in-an-action/67988/12 "2023-11-28T19:23:34Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
