# Single value from multiple tables

**URL:** <https://community.glideapps.com/t/single-value-from-multiple-tables/52286>\
**Category:** Ask for Help\
**Created:** [October 22, 2022, 7:32pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286 "2022-10-22T19:32:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [October 22, 2022, 7:32pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/1 "2022-10-22T19:32:19Z")

</div>

Hi,  
I have an app where the user inserts about 10 types of forms to different tables.  
I want to show the last time that the user inserted a form of any type.

In SQL What I need is :  
SELECT  
MAX(dateTime)  
FROM  
(SELECT MAX(dateTime) FROM Table 1  
UNION  
SELECT MAX(dateTime) FROM Table 2  
UNION  
SELECT MAX(dateTime) FROM Table 3  
… etc  
)

I am looking for a solution without using an action to update the current date and time in the user data on each form insert.  
Is there any way to get a single value from multiple tables?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [October 22, 2022, 7:35pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/2 "2022-10-22T19:35:21Z")

</div>

just update the time in the user sheet… everytime they submit the form, use after submit action

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [October 22, 2022, 7:36pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/3 "2022-10-22T19:36:44Z")

</div>

> [@Lin\_Altshuler](#):
>
> I am looking for a solution without using an action to update the current date and time in the user data on each form insert.

…

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [October 22, 2022, 7:40pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/4 "2022-10-22T19:40:07Z")

</div>

then you need to get the max time using rollup column and IF\_ELSE column to get the user email or row ID

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 22, 2022, 11:52pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/5 "2022-10-22T23:52:18Z")

</div>

Just curious, why don’t you want to use an action to update a field in the user profiles table?

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [October 23, 2022, 12:09am UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/6 "2022-10-23T00:09:33Z")

</div>

Its an app for collecting data on Autism for behavior analysis professionals.  
The users are mainly the parents of the autistic kids, teachers and professionals that view and analyze the data to build a long term program.  
so the data is saved under a different entity: the kid, not the user that fills the form…  
Just more work, and I was also curious if anyone thought of it because I couldn’t find a solution without 10 extra rows.

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [October 23, 2022, 3:28am UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/7 "2022-10-23T03:28:46Z")

</div>

I do not get, 10 extra rows??? each record is 1 row… now, to get the user record… is one column… to get the max value… is one more column… so, just 2 columns…  
it looks like your data is spread across multiple sheets/tables… if these are Google Sheets… then you need to join all sheets into one… if is Glide tables, do rollup max on each table with the user id assign to the value… then the rollup again max value from that… not an easy way… but the only one

---

<div class="post-metadata">

**Author:** ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)\
**Post date:** [October 24, 2022, 2:21pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/8 "2022-10-24T14:21:36Z")

</div>

> [@Lin\_Altshuler](#):
>
> because I couldn’t find a solution without 10 extra rows.

This has been an issue a time ago. I guess we need a “easy” way to do it

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 24, 2022, 11:59pm UTC](https://community.glideapps.com/t/single-value-from-multiple-tables/52286/9 "2022-10-24T23:59:34Z")

</div>

You should be able to build the relation to the related kid, though? From that relation, you can use set the column method, I suppose.
