Conditional visibility of components usage question

Bravo on this feature release @Mark . Saw the announcement in app but haven’t seen in mentioned in the forums yet.

Quick question about implementation, is there a way this can be used which bases it on a condition of the signed in user?

Basically i’m trying to accomplish user roles where if the user has a role assigned of “x” they would be able to see the component.

1 Like

Not yet, but that’s definitely something that will be possible eventually.

1 Like

What is this used for then, can’t think :thinking:

There are lots of things that this could be used for, but thinking back to a previous thread, I had created a small example to show or hide an image button based on the value in a different column. That example was intended to hide a button once a user had a count of 50 it more in a column…so they couldn’t submit not than 50 times for example. Another example would be to only show a button to allow someone to proceed if they agreed to terms and conditions. It’s probably one of those features that won’t make much sense until you run into a situation where you actually need it.

It’s very useful in forms, for example, where you might have to enter more information if you select a particular option.

I used it in a party RSVP app. If you select “Are you coming?”, you get new questions “Are you bringing a +1?”, and “Any dietary restrictions?”.

2 Likes

@mark, can you elaborate a little bit more on your RSVP app? I’m trying to see if I can control which entry components show based off of other components in an Add/Edit/Form scenario. It seems to work fine when in View mode. I’m just trying to establish if it’s possible or not.

I’m just discovering that we have a bug - in a screen where you edit a row (add/edit/form screen) the visibility should be conditional on the edited row, but right now it isn’t.

My RSVP app just used a regular detail screen with edit components.

1 Like

Sorry but what am I missing? Was there announcement in conditional components?
Can someone share? Currently I create this myself with images …

@mark Seems to be working in Add/Edit mode

@yinon_raviv You can now add conditions to show or hide components based on other component or column values. Here are some screen shots that show how to do it.

Select a component to edit it’s details:

Select the Features tab:

Add the condition you want:

Capture3

Yes, we fixed it :wink:

1 Like

Documentation for visibility is here now: https://docs.glideapps.com/all/reference/layout/component-visibility

And I made my own version of Mark’s party invite app with conditional visibility. You can copy the app and check it out if you want. https://partyinvite.glideapp.io/

5 Likes

hey @Mark!! what’s up?

about the conditional visibility depending on the type of user, any news on that?
I have tried a few alternatives, but wasn’t successful on any of my attempts.
One of them, which I thought would work was a type of user column on the entry tab.
Then, I would like to show, on a different tab, depending on the type of user an inline list.
So, on that tab in glide, I associated it with the entry tab, where I had the column with the type of user, and added an inline list, adding a feature, conditional visibility, to that type column.
But it just didn’t work.

Any ideas on how I could make it work?

Thanks a lot!

We’re actively working on that.

Hey guys,

I’m trying to build a two-side marketplace at the moment looking at a few no-code options, but am loving playing in Glide and following all the new releases/ features. Initially I had two apps/ one spreadie, but am now trying to convert to one app, after I realised you can’t comment between them which I was using as a 121 chat function.

I’ve had a few goes at this problem you’re talking about and one option seems to be working, but would like to know what you think and if it will scale with multiple users.

Under the profile section I have ‘users emails’ column and ‘user type’ column, then I have ‘if column’ that says ‘if users email is user that is signed in, show user type value’

Then in the tab I want to make different inline lists visible depending on user type (user 1 to see availability of user 2’s and user 2 to see jobs posted by user 1’s). I have 6 columns, just 1 row. The first two columns just say user 1 and user 2 in row 1; the next two are relation columns to match these values to the ‘if column’; the final two just show ‘user 1’ if that profile type is signed in or ‘user 2’ if that profile is signed in (you can use a look up to get the value from the ‘if column’ in profile sheet).

Then set inline lists on component visibility to be visible if your columns 5 & 6 show the profile type you want (inline list for user type 1 only if column 5 says ‘user 1’ etc.)

@Mark what do you think, is this the problem discussed or am I overcomplicating and there’s an easier solution? Do you think this scale with multiple accounts on the app, my assumption is the if column value will be unique for everyone, so it should work…?!

@Cesar_Huber Here’s some more information on a method that I use for conditional visibility based on user type. Basically I use a template column to create a value, such as ‘Admin’. In my user sheet I have a similar user type value, but only on the users that have Admin access. I then create a relation column to link the template ‘Admin’ to the user’s user type column. Then I create a lookup column to pull back an array of user emails that match the value ‘Admin’. I can then use the lookup column for filtering or visibility based on signed-in-user.

@George_Lewis1 I’m really intrigued with your method. I might have to read through it a few times to see if I get some ideas. You don’t happen to have a sample app that you can share, do you?

Hey I can’t share the app, but i can recreate one if helpful? Did you get it working? I tried your method and that works as well thanks :slight_smile: I’ll keep both in for now and see which one works when we’re scaling up!

@George_Lewis1 Thank you! The method I’ve used has worked well for me and others in the past, but as you’ve noticed in the other thread, I do understand how you method works now, so no need for a sample app. I do thank you for putting this thought process in my head. It definitely opens up a lot of opportunities to pull back much more data, per user, than just an array of emails. As you’ve noticed, there’s the potential to display all kinds of user specific data from other sheets or use it for filtering and visibility and I suppose it allows for passing those values into a form as well which could really be beneficial. I’m sure I’ll be referring to this much more from now on.

It will be interesting if you run into any scaling issues down the road. I suppose your method is much more efficient since you are only pulling back relevant data as opposed to the massive list of emails.

Again, thank you for this.

2 Likes

That’s great, excited to see what you guys do with it now!

1 Like