Get data

Hi,

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

I also have an other table (Participants), where I have next to the name a counter (számláló) as well, like this:
image

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

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?

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.

1 Like

Hi Eric,

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

1 Like

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. :slight_smile:
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?

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.

3 Likes

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)?

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.

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.

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?

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.

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?

Yes :slight_smile:

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

Data or Layout or both?

Both would be ideal.

Data Tables:
Events:

Expenses:

Layout:
Events:

after I click on the Event it opens:

and after that I don’t how to proceed.

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.

1 Like

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

1 Like

Sofar:

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


I can add a name, dates and participants from Users:

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


With the “+ Add” button I can add an expense to it:

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?