Filter costs on tab for the current project

Hi,
First time Glide user and first time attempting to build an app and I have hit a roadblock with my projects cost app.

I have the Projects on the first screen, click on that and it takes you through to that Projects details and then I have a “add costs” button, which takes you to another tab and it will list the costs already entered, plus a + button to add more costs.

Problem is, that “costs” tab lists all the cost for all the projects and I want it to just list the costs for that particular project?

The Choice Button is just set up to “go to tab”.

I am not sure what other details will be helpful and what won’t.

Thank you for any help :slight_smile:

Hello, welcome to Glide :waving_hand:

Data editor
In the Projects table, create a relation to the Costs table. Set it to multiple.
Ideally, create this relation using row IDs and not the name of the projects.

More on relations
More on row IDs

Layout editor

On the project details screen, add a collection component and source it to the relation created above. When configuration the collection, include a title bar action and set the action to “Show Form Screen”.

Thank you Nathan,

I’ve done the steps up to "When configuration the collection, include a title bar action and set the action to “Show Form Screen”. You lost me there if I could have a few more details please?

Thank you so much for taking the time

You’ll almost there:

1 Like

Thanks again.
I have done all those steps, but something still isn’t right, I am not sure what I have missed.
You can see both Projects listed under this project in the screenshot and I have attached my Relation and Collection settings as well.



Seems your Project ID value in the Costs table is not storing true rowIDs but values like “New Entry” or “Project 1”. Can you verify?

It’s definitely not, I seem to have a big problem, because I was hoping that when I am in a particular project and I click my “add costs” button, it automatically fills in the Project Name and ID, but the only way I can get it to “work” is if I add my Choice options and select Project Name, then Project ID, then the Inventory Item, then the Item Cost.
So I probably need to do some more reading and watching of videos and start again

Are you using an Add Row action or a form? Either way, show us a screenshot of how you’re adding the row and we’ll show you how to add the project ID.

Ive tried both ways and couldn’t get the result, so I am happy to go with best practice.
In data I have a Project, Inventory and Usage table. I have it set up so I can add Projects, no issues there so far.
When I tried to use the + button on the Project Detail screen, it only lets me write to Projects and I need to write to Usage.

So I added a Project Expenses Tab and set the source as Usage, which works, but I have to select the Project Name and Project ID. I put a button on the Project tab that goes to the Project Expenses tab.

Then I tried a Button with add row and with workflow, but its creating a new project ID, rather than linking to the one I was in.

Thank you for your time

What type of “button” are you seeing here? If it opens a form, you should be able to change the target table of the form to the Usage table.

Then, you don’t need to do this, and in the form above you can reference the project’s ID to be written to Usage.

You don’t need the Project Name to be written. You can do a relation + lookup to get it to the Usage table. That way, it always links to the Projects table.

Otherwise, you risk the name in Usage not being updated when you change the name in the Projects table. If you want it to be updated, it costs you an action to do so.

I did have the screenshots in there, but I think I have that part working now. The Project ID is coming through, and everything is linked.

1 Like

Good to hear!