# Get data

**URL:** <https://community.glideapps.com/t/get-data/75946>\
**Category:** Ask for Help\
**Created:** [August 28, 2024, 12:48pm UTC](https://community.glideapps.com/t/get-data/75946 "2024-08-28T12:48:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 28, 2024, 12:48pm UTC](https://community.glideapps.com/t/get-data/75946/1 "2024-08-28T12:48:07Z")

</div>

Hi,

I have one table (Expanses) where I have these:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/5/95a96638417ff57558b6316f2bb8d2e4b1e1dcc5.png)

I also have an other table (Participants), where I have next to the name a counter (számláló) as well, like this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bdccf1a77bec42f057f2acc32440844f3021df05.png)

I’d like to have in the Expenses table the “számláló” numbers.  
For example “Paidby\_P2” in the first row is “Robi”, so it should be 4, and for the 2nd row (Mikes) it should give 3.

How can I do that?  
Thx

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [August 28, 2024, 1:09pm UTC](https://community.glideapps.com/t/get-data/75946/2 "2024-08-28T13:09:31Z")

</div>

With a single relation column from Paidby\_P2 to the Name column in participants and then a lookup column via that single relation.

But I think you have another problem which is the structure of your data. Could you explain how you expect the expenses table to work?

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 28, 2024, 1:18pm UTC](https://community.glideapps.com/t/get-data/75946/3 "2024-08-28T13:18:12Z")

</div>

Thx, I could make it work.  
I’m new with Glide, so I am just playing around. It was just a part of my tables, there are already lots of columns. I hope I can continue my plan thx to your help.

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 29, 2024, 9:33am UTC](https://community.glideapps.com/t/get-data/75946/4 "2024-08-29T09:33:59Z")

</div>

Hi Eric,

yeah, you were right. It’s definitely the structure of my data. 😄

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 29, 2024, 3:34pm UTC](https://community.glideapps.com/t/get-data/75946/6 "2024-08-29T15:34:57Z")

</div>

I’ll try to describe what I can’t do and I hope you can help me.

I’d like to have:

1. Events (it has a name and it has also participants (selected from users)
2. Expenses (relate to the event, location, spent amount, paid by (selected from event’s participants) and I also would like to define who spent how much)

So, I’d like to create an Event and either with click on the event, or separately on the Expenses Page add a new expense (but it should be related to the Event). After that they need to define the Paid Amount, and also who paid it (could be multiple persons). After that it should be defined who paid how much.

I don’t want to go further, I’ll be more than happy if I could manage this all. 🙂  
On a summary page I’d like to see by events who spent how much and what was the total.

I made an Events table, an Expenses table and have the Users table.  
With this setup am I able to have that, or do I need more tables with more relations?

---

<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:** [August 30, 2024, 12:42am UTC](https://community.glideapps.com/t/get-data/75946/7 "2024-08-30T00:42:15Z")

</div>

**Events table**

| Event ID | Event name |
| --- | --- |
| E001 | Event 1 |
| E002 | Event 2 |

**Users table**

| User ID | User name |
| --- | --- |
| U001 | John Doe |
| U002 | Jane Doe |

**Expenses table**

| Event ID | Expense ID | Expense name |
| --- | --- | --- |
| E001 | X001 | Buying BBQ |
| E001 | X002 | Buying wine |

**Expenses payments table**

| Expense ID | User ID | Amount |
| --- | --- | --- |
| X001 | U001 | $5.00 |
| X001 | U002 | $10.00 |

I think you should have a form to add an event, and leave the expenses and payments later.

In the details view of an event, have a collection/form to add an expense, and in an expense, have a form to add payments related to that expense. You can bring over IDs for relations inside the form using special values.

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 6:47am UTC](https://community.glideapps.com/t/get-data/75946/8 "2024-08-30T06:47:11Z")

</div>

Hi,

thanks for that, most of the things are the same how I built up this previously. The only thing is different is the Expense payments table. That makes sense, thank you.  
But how can I add multiple rows to this table (same Expense ID but different User IDs)?

---

<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:** [August 30, 2024, 8:29am UTC](https://community.glideapps.com/t/get-data/75946/9 "2024-08-30T08:29:41Z")

</div>

Do you mean adding multiple rows at once or not? If it’s not at once, you can just use a form in the Expenses details view for that.

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 9:08am UTC](https://community.glideapps.com/t/get-data/75946/10 "2024-08-30T09:08:00Z")

</div>

I mean at once.  
Because multiple participants can be selected as payers, I’d like to name them and give the paid amount to them. It’d be nice not to make it step-by-step with form.

---

<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:** [August 30, 2024, 9:10am UTC](https://community.glideapps.com/t/get-data/75946/11 "2024-08-30T09:10:36Z")

</div>

If you would still need to type things out, I would suggest using a Form Container. You don’t need to click and open a form, it’s a component right on the screen, and you don’t need to leave the screen. Just choose a payer and an amount, then click add, then do the next one. Is that good enough?

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 9:57am UTC](https://community.glideapps.com/t/get-data/75946/12 "2024-08-30T09:57:36Z")

</div>

Hmmm, I think I might still missing something.  
For example: I have 5 participants (1,2,3,4,5) to an event.  
For that event I create an expense about 50 Eur. 50 Eur was paid by participant 2 and 5. I’d like to define who paid how much.  
With the Form Container I can’t get the names only for 2 and 5. And I’d like to be sure that the given numbers (paid amount each) are not greater or less than 50 Eur.

---

<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:** [August 30, 2024, 10:03am UTC](https://community.glideapps.com/t/get-data/75946/13 "2024-08-30T10:03:30Z")

</div>

Taking your example, it would be 2 rows in the Expenses payments table, one for participant 2 and one participant 5. Isn’t that what you want?

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 10:04am UTC](https://community.glideapps.com/t/get-data/75946/14 "2024-08-30T10:04:12Z")

</div>

Yes 🙂

---

<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:** [August 30, 2024, 10:04am UTC](https://community.glideapps.com/t/get-data/75946/15 "2024-08-30T10:04:47Z")

</div>

> [@Zoli](#):
>
> With the Form Container I can’t get the names only for 2 and 5.

Then I’m not sure why this wouldn’t work. Can you show me how you set it up?

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 10:08am UTC](https://community.glideapps.com/t/get-data/75946/16 "2024-08-30T10:08:02Z")

</div>

Data or Layout or both?

---

<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:** [August 30, 2024, 10:09am UTC](https://community.glideapps.com/t/get-data/75946/17 "2024-08-30T10:09:43Z")

</div>

Both would be ideal.

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 10:16am UTC](https://community.glideapps.com/t/get-data/75946/18 "2024-08-30T10:16:31Z")

</div>

Data Tables:  
Events:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/4/a462971ea6a210ce2ec34bb5c12a26d51db5e063.png)

Expenses:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/a/8a7982ffa175fc92d6c443b114d4511337b947a3.png)

Layout:  
Events:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/e/4e9bc8a038d22d7dfeadad410d1a248805a71d0a.png)

after I click on the Event it opens:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/3/133f7028a3252dd088f161d11178b2c5a3dcb2a8.png)

and after that I don’t how to proceed.

---

<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:** [August 30, 2024, 10:20am UTC](https://community.glideapps.com/t/get-data/75946/19 "2024-08-30T10:20:49Z")

</div>

You should show the details view of the events when a user clicks an event.

Then add a collection of related expenses, in the “title bar action” section of that collection, add a form to enter new expenses.

Do the same for the expenses - payments relationship.

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 10:23am UTC](https://community.glideapps.com/t/get-data/75946/20 "2024-08-30T10:23:27Z")

</div>

Ok, thanks, I’ll make a try and come back with my feedbacks. 🙂

---

<div class="post-metadata">

**Author:** ![Zoli](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/zoli/32/78396_2.png) [@Zoli](https://community.glideapps.com/u/Zoli)\
**Post date:** [August 30, 2024, 2:58pm UTC](https://community.glideapps.com/t/get-data/75946/21 "2024-08-30T14:58:25Z")

</div>

Sofar:

I can create Events with the “+ Add” functionality.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/d/8d32a157a03e415bc65a0b38a5d8d1a542eb184c.png)  
I can add a name, dates and participants from Users:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/ebe6c665b9b8c284782dc033e01b57664cc2c8de.png)

After when I click on an Event, its Expenses come up, fine:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/0/307a6e98039eb8ccd2c24926b9fa0ac7c2d0b848.png)  
With the “+ Add” button I can add an expense to it:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/b/0b9a9935dc15c207f51c5ef2a13d884dec2ea558.png)

But after giving all the infos here, I’d like to be able to add also who paid how much. How can I do that?

[Next page](https://community.glideapps.com/t/get-data/75946.md?page=2)
