Dynamic pages based on URL parameters

My Goal
I would like certain external (non-logged in) users of an app to see different data based on the URL link that is sent to them by internal users. This could easily be accomplished by creating multiple pages (tabs), then filtering the collection on each one as desired and then creating a system to select the page/tab that they want the external user to see. But that can be tedious to create and doesn’t work in every situation I’m envisioning. I want to do something that is dynamic.

Explanation
Here’s the scenario. Internally, teams are divided up, let’s say they are called Team Alpha, Team Beta, Team Gamma. And each team has different items that they are managing. Internally, one can use the Users table to set roles and have one page for “team items” that display different items depending on the user’s team as set by the role column. (Alpha members see items tagged Alpha, Beta sees Beta tagged items, etc).

But I also want say, team Alpha, to be able to send a similar page to external users and the external users sees just those Alpha items without the external user having to be logged in or select anything…it just shows the Alpha items or the Beta items by default. Conceptually, if the url of the page was accessible as a filter, that would work.

For example if the url was http://myapp.example.com/dl/TEAM?Alpha you could filter the collection where the end of the url value equals a value in the table. And you could use a template column so that the same url for the page with the slug TEAM appends a different value at the end depending on the role of the person sending the url (I.e. team alpha members, when they send the url are automatically sending a url with “alpha” in the address).

I don’t think this approach is currently possible, right? If that’s true, is there another way to create what I’m talking about? I.e. that an internal user generates a link to a page that shows different data based on the internal user’s role (or some other variable)?

Ya, this is possible, but not fool proof. You can use URL parameters for filtering purposes, but if the user edits the URL then they’d be able to “clear the filter”.

Thanks @Robert_Petitto. Where do I find the url parameter filter? I didn’t see it in the filter setting in the collection. Maybe I just didn’t look in the right place or not recognizing what it is.

1 Like

@Jeff_Hager Oh sweet. Ok. Very nice.

1 Like

This is pretty cool.
To summarize the steps (and please correct me if I’m getting this wrong).

You add the “get part of url” column to your table. Let’s say we called that column “roleFilter”. In creating that column, for the URL value, choose “the url of the current page.” For the “part” value you are going to be giving it a name, for example “group”, which will be the parameter name you will use in the url. So for example, In the url you would append “?group=Alpha” if you wanted to filter the page by those items assigned to the Alpha group. In my example the values Alpha, Beta, etc appear in a column called “role”, so we are going to compare that column with the newly created “get part of url column” value to filter our collection. To do that, on the page to which you want to apply this value to filter items you would select your collection, and create a filter for the collection that says “role” column is “roleFilter” column.

Now, as you change ?group= from alpha to beta etc and reload, the collection should change. Did I get that right?

1 Like

Yes, that sounds correct to me.

1 Like

:point_up_2:

1 Like

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