Button help

Hello everyone
I just wanna use button and extract only some data from certain sheet is that possible
Example: if I wanna use button for accommodation can it only extract one location data from sheet

1 Like

Hi @Prashant_Shrestha :slight_smile:

Could you be a little more specific, maybe providing us a real example?

When you say extract, it is about using data from a specific table in the layout or creating a CSV file?
What data do you want to retrieve?

3 Likes

Hello sir
When I want to select accommodation from Kathmandu it opens all accommodation I want only Kathmandu to be displayed
Is it possible
All accommodation are in single sheet do I need to separate it
Sorry I am very new to this so I am very much confused and cannot properly say my problem

(attachments)


What do your tables look like? You should create a relation linking your location table to your accommodations table. When you select a location, it looks like it takes you to a detail screen that shows details on the location. You can set up your button to show a new screen linked to ‘This Item’, which would take you to a new screen linked to the same location detail row. On that screen, add a collection sourced from the location so it only shows accommodations for the selected location.

1 Like

You should probably have two different tables for easily create this. I would be really simple to achieve this behaviour using a Relation as @Jeff_Hager mentioned :wink:

Tables

Table 1 | Accomodations
Data about Accomodations only, with a Itinerary ID colmun where you stored the same unique ID as the related data in Departures table (see below):

Name Description Itinerary ID
Mountain Lodge Mont Everst Base Camp 1
Trekker’s Inn Annapurna Circuit 1
Campsite Kilimanjara Summit 2

Table 2 | Departures
For example, based on your screenshot:

Itinerary ID Day Location Height Notes Highlights
1 1 Kathmandu 1600m Drive to Pokhara kathmandu
2 Kilimanjaro

Now, to get all Accomadations for this specific Departure, you can add a Relation column is this table where you match all values from the Accomodations table where Itinerary ID is the same.
You can follow along the quick tutorial available here: https://www.glideapps.com/docs/relations


Layout

In your detail screen (the one showing Kathmandu for example), you can now create a button (or add an action to a Title component, it’s the same logic) to open another Screen which will use the Relation as source.
This way, you’ll be able to display only related accomodations thanks to the relation you just added :wink:


And of course, welcome to Glide. Feel free to ask if you need a more detailed explanation.
I just add a general advice about your data: as soon as you have one or many things related to something else, it’s probably relevant to create two different tables to store these information. Your use case is a wonderful illustration of that :slight_smile:

3 Likes