# Is it possible to show an element on page load based off the current page URL?

**URL:** <https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316>\
**Category:** Need help\
**Created:** [February 11, 2018, 12:41pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316 "2018-02-11T12:41:07Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 12:41pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/1 "2018-02-11T12:41:07Z")

</div>

I’m trying to pass along data to a popup and open it if when the webpage loads, the URL contains a data type’s unique ID (doesn’t have to be a specific ID, just contain an ID type).

Any way to do this?

Thanks ✌

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 2:04pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/2 "2018-02-11T14:04:04Z")

</div>

I have an app that creates a unique url for each user. If I were to have a pop open only when the URL contained a specific users unique id, the workflow would look like this. I think the critical part for you would be the “Only when” criteria which in my example is “This url contains Current User’s unique id”  
You could set it up to pass certain data to the popup based on that user’s unique id (ie search for user data and use unique id as search criteria). Hope this helps…  
tx  
Nikolai  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/2/c2dbd4d6a652c2b516f236a06f9c1b9de8c35bd3.png)

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 2:34pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/3 "2018-02-11T14:34:03Z")

</div>

@nikolai The issue I’m having is the “only when” criteria doesn’t allow me to search for a specific data type. So “only when - do a search for data type x’s unique ID - is in URL” is what I’m trying to do.

For some reason, it won’t allow me.

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 5:15pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/4 "2018-02-11T17:15:25Z")

</div>

Will setting it up something like this work for you? It allowed me to open a popup.  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/f/3fa5043a22de463fb32c5d687a2eeb984e4af60f.png)

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 5:22pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/5 "2018-02-11T17:22:43Z")

</div>

Ah this worked! Filtering it by “first item” won’t restrict the search to only the first unique ID in the database?

Thanks!

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 5:24pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/6 "2018-02-11T17:24:42Z")

</div>

Also, how do I then go on and pass that unuiqe ID to the popup?

Thabks again.

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 5:40pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/7 "2018-02-11T17:40:12Z")

</div>

During the page loaded workflow, you need to “Display data” in the popup you want the data to be used in before opening the popup. In my example I used “Current Page User” for “Data to Display”. You may need some other parameters instead for your app.  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/b/7bfe7d5b34d26b86ef43a59d09605f2c320f0db5.png)

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 5:42pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/8 "2018-02-11T17:42:18Z")

</div>

Gotcha. So there’s no way to use the data being found in the URL as the data to send to the popup? Or am I missing something?

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 7:33pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/9 "2018-02-11T19:33:01Z")

</div>

My understanding of bubble’s url’s is that the url will contain your page name plus the unique id of whatever Data Type you’re sending to that page (ie User, Automobiles, Sports, etc) (ie something like [https://mysite.com/version-test/test\_page/925455610979111805x92](https://mysite.com/version-test/test_page/925455610979111805x92)). So when you goto a page,you’ll have “Data to send” . In the example below, I have Picture as the Data Type of the page called “test\_page” so I can send that page Picture data. If you send “test\_page” different data of type Picture, each actual Picture instance will have a unique\_id that you can search on. Then on that page, you can do the popup stuff described earlier. Make sense?  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/2/6/260fa25185333f6837caa52f1e841379f6370e2a.png)

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 7:39pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/10 "2018-02-11T19:39:28Z")

</div>

In my url example above, if you had 3 different instances of a Picture (say a picture of an apple, picture of orange and one of a banana), if you go in the database, each of the three will have a unique\_id. That respective Picture’s id will be added to after the url with “test\_page” in it (depending on which ones data is sent to “test\_page”

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 7:50pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/11 "2018-02-11T19:50:37Z")

</div>

I should also have mentioned that when i did a little test on this, for the popup i created, i had a text element that showed Current Page Users unique\_id to verify i was passing the correct unique\_id to the popup

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 8:05pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/12 "2018-02-11T20:05:20Z")

</div>

Ah ok. This makes sense, thing is, I’m not sending a user from one page to another, this would be a link shared outside of the site, and incoming users would view a project shared by this link.

In my case, I can’t refer to “current page’s x”. Unless I can somehow set the state of the page to the URL’s uniquqe.

---

<div class="post-metadata">

**Author:** ![nikolai](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nikolai/32/13582_2.png) [@nikolai](https://forum.bubble.io/u/nikolai)\
**Post date:** [February 11, 2018, 8:26pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/13 "2018-02-11T20:26:57Z")

</div>

Not sure if this is helpful but for one of my apps, I create a unique url based on the unique\_id of User. That unique link is shared with users outside of the site. So users who have access to that url will go to a bubble page with info for them to see.  
In your case, instead of using User unique\_id, you might have a Data Type of “Project” and as you create projects, each will have its own unique\_id. Then for each Project page that gets created, you’d have a unique url for each page which you can share with people outside the site. When they come to the site, you can to the searching activities from earlier in the thread to provide those users with whatever it is they need to see. Make sense or are you looking at something a bit different?

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [February 11, 2018, 8:32pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/14 "2018-02-11T20:32:06Z")

</div>

Yes makes sense. Sounds like a popup solution instead of a project per page method, comlicartes things. I’m going to try this way.

Thanks alot for your help!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 22, 2018, 12:41pm UTC](https://forum.bubble.io/t/is-it-possible-to-show-an-element-on-page-load-based-off-the-current-page-url/24316/15 "2018-04-22T12:41:18Z")

</div>

Closed on April 22, 2018, 12:41pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
