Showing single item which is part of collection in frontpage

Hi,

I’m quite new to Glide and I’m building a MVP for a customer and I have a have run into an issue I cant figure out.
I have an app where you can book equipment and if you have access to more than 2 pieces equipment everything is fine (you get a list of your bookable equipment). If you only have access to one piece of equipment the front page should load the details view of that piece instead of loading the collection. I have sorted to have different views depending on # of pieces of equipment (doing a computed column in the user table).
I tried to do a single value column with the first piece but I could not access the data in the custom screen I created.

Could someone give me some pointers. It would be greatly appreciated!
Regards
Quaint

How do you define “access” here? Do you have a column to indicate that? Let’s assume you have one and it’s a boolean called “Visible”.

What I would do is:

  • Point the tab to the Equipments table and filter the screen to “Visible” is checked.
  • Have a column in your user profiles table that is a rollup over the “Visible” column in Equipments table and set it to “count True” so you know how many equipments you have access to.
  • Back to the tab, if the count above is > 1, display the collection. Else display the elements that are the same as the details view of the equipment.
2 Likes

Thank you!

I have done almost as you outlined for the visibility (I used the term access wrong as it is just a visibility filter).
Do you mean that i should use a custom collection or are there any other way to just get the details view for a specific row? It seems to me that you mostly design using collections but I have just started to use Glide so I’m probably wrong

Thanks for your pointers!

Thinh’s first bullet point described how to attach the screen to a specific row by using a filter on the screen.

The second bullet point explains how to determine if a user has access to more than one row.

The third bullet point explains how to use visibility to either show a collection or show individual components for a specific item based on the result of the Rollup.

2 Likes

Thanks Jeff! I think I got those steps right but I wondered how the view for the single item was created. You could always do a custom collection view with only one result but is it any other way to do it?

If set up correctly, the screen should already be filtered to the first matching row. Just add regular components such as a text component to display the details from columns in that row.

I think you are stuck on thinking that you need two collections. Instead, display a collection only if the Rollup is greater than 1. Display the text components only if the Rollup is equal to 1.

Add a text component and a collection component to your screen. Then you can proceed from there.

2 Likes

Thanks! I marked @ThinhDinh as a solution even though you provided me with a piece of the puzzle. Coming from a programming background some concepts which are easy in programming are quite hard to grasp in Glide (probably you would feel the same if learning programming after glide)

1 Like

I’ve been a software engineer at my current job for over 20 years. I work with mainframe backend and web development so I’m pretty used to different programming and interface concepts and having to switch back and forth on a daily basis. Same with Glide…some things do take a different way of thinking, but I feel a programming background will be a great asset for you because you already understand general logic and database concepts. Like you, I also find that some things in Glide could be accomplished more easily with actual code, but in general there is always a way to get something to work. It’s just a matter of learning all the pieces and putting them all together. The biggest thing to grasp in Glide is that your “programming” happens inside of your data, as well as understanding how screens are connected to that data. Once you get past some of the intricacies of Glide, you will find it to be quite easy.

Glide has a university and documentation to help get you started. Also spend some time in the forum, even if you just read the content. You will learn a lot of tips and tricks that way.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.