Using If, Then, Else statements to make a Custom Action Button

Hey everyone! I have another question for this amazing community. I made a loom video here explaining everything. I hope I was making sense in the video, just in case ill describe my end goal here as well.

I want to create a button that will show on the Details screen of each piece of content that will take the user to a page showing the social media of that specific content creator. So if this video was created by John Doe, I want the button to take the user to John Doe’s information. If it was created by Alex F, I want the button to take the user to Alex F’s information. And so on with multiple different creators.

With this route of just making a bunch of If statements, I fear that as I have many different creators, things can get messy. Another idea is have some sort of loop that sees the creator is John Doe and it goes through all the sheets until it finds one titled that same name. Then it will show that screen.

Loom Video

Please let me know what you guys think of this. I’m sure there are multiple ways of going about this. I am still learning Glide and I am also new to Logic Statements. Thank you all so much! Cheers!

Hi @mn2000,

Why you have different tables for each user? You can add all users to the Users table and just have a table for videos and in that table you can add a email column to specify which user created that record! And then in the Users table you can create a relation between the email and show them on the screen.

When you click on the button and to go to that user’s details page you can build a relation that is single in that table ( videos ) and add that to row in the show detail screen or show new screen and then in there you can access the details of that user!

Here’s a example : comment creator.mp4 - Google Drive

Thank you

2 Likes

Hey Dilon!

Thanks for that idea it makes much more sense to go that route.

I have separate tables because the content creators aren’t users. Users won’t be creating any content. But I altered this approach a little. Let me know what you think. I hope this helps others trying to accomplish the same thing or something very similar as well.

I created a sheet specifically for the content creators called Creators Social. Just a list of their social medias, followed by links to them, an icon correlating with the social media platform, then a text column titled Creator which includes on each line the name of that creator.

Then in a sheet called Videos, I have all the information for the video, again a text column titled Creator with that creators name. Then a relation Column with these details:

Ensuring Match Multiple is checked as we want it to show all the social medias of each content creator.

The button has a custom action that looks like this:

Data pulls from that relation column made in the sheet called Videos.

Thank you for your help again Dilon it is much appreciated!

I think your approach won’t be efficient row-wise. If you want to simply show a list of social media links for the creator, you can create columns horizontally in the same Creators table, you don’t need to have a separate table for each one because it will be hell to maintain.

I had a custom code snippet from a while ago to help with that. Let me know if that works for you.

Yes, I agree, it’s technically functional but it will eat up a ton of rows. I’m getting confused on how I should set up the table to be horizontal.

I made a new sheet to add all the same Creator Social Media info horizontally.

And in my Videos sheet changed the relation to link to this new sheet. It doesn’t populate the information correctly, it puts it all into one item.

I thought maybe use the Split Text to separate everything. But it doesn’t seem to allow with a Relation Column.

It’s also giving me on screen problems. With everything being vertical, I was able to have columns labeled Icon and Platform. For each image shown on the front end I set it to the Icon Column and then for the text underneath each image it was set to Platform. So I would see a screen of tiles with their correlating icons and platform names. But with having it horizontal, I can’t do this.

What should I do from here?

Thank you all so very much!

Hi Madiee,

Check this video and let me know! : Loom | Free Screen & Video Recording Software

Thank you