# Dynamic pages based on URL parameters

**URL:** https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359
**Category:** Ask for Help
**Created:** [March 2, 2024, 5:29pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359 "2024-03-02T17:29:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)
#### Post date: [March 2, 2024, 5:29pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/1 "2024-03-02T17:29:19Z")

</div>

**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)?

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [March 2, 2024, 5:41pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/2 "2024-03-02T17:41:38Z")

</div>

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”.

---

<div class="post-metadata">

### Author: ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)
#### Post date: [March 2, 2024, 6:13pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/3 "2024-03-02T18:13:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 2, 2024, 6:25pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/4 "2024-03-02T18:25:36Z")

</div>

> [@How to pass parameter to glide apps?](https://community.glideapps.com/t/how-to-pass-parameter-to-glide-apps/40090/5):
>
> Yes, here is an example: Try it with the below App: ps. I should add that I actually learned this trick recently from @grumo slight_smile

---

<div class="post-metadata">

### Author: ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)
#### Post date: [March 2, 2024, 6:29pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/5 "2024-03-02T18:29:08Z")

</div>

@Jeff_Hager Oh sweet. Ok. Very nice.

---

<div class="post-metadata">

### Author: ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)
#### Post date: [March 2, 2024, 8:25pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/6 "2024-03-02T20:25:45Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 2, 2024, 11:15pm UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/7 "2024-03-02T23:15:18Z")

</div>

Yes, that sounds correct to me.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 3, 2024, 1:15am UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/8 "2024-03-03T01:15:24Z")

</div>

👆

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [March 10, 2024, 1:15am UTC](https://community.glideapps.com/t/dynamic-pages-based-on-url-parameters/71359/9 "2024-03-10T01:15:31Z")

</div>

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