Get data from page URL: "Path" VS "Path segments as list"

There is a question I’ve been interested in for a long time but always forgot to ask.

In web development a path is a component of an URI (URL) that points to the exact location of a resource (page, file…) on the web server. And it is located right after domain name:

As we can see above - the path consists of a sequence of path segments separated by a slash character.

So what I expect while using Get data from page URL with path option chosen is to get at least page name. But Bubble returns empty value.

So here are results of applying Get data from page URL with path and path segments as list options applied:

URL path path segments as list
mydomain.com/user (empty) user
mydomain.com/user/id id user, id

As you can see - for some reason Bubble ignores page name (user) if I’m using path option. But as soon as I use path segments as list - page name is included in the list of path segments, so Bubble considers page name as a part of a path.

From path description in Bubble Manual it is obvious that this is an “expected behaviour”:

If you select path, you can retrieve ‘hello’ in the URL ‘PayRam: Accept Crypto payments on your server. A self hosted crypto payment service.
[source]

But could anybody kindly explain me why? :slight_smile:

1 Like

Why would you need to retrieve the page name from the URL?

You always know what page you’re dealing with (unless it’s a reusable element, in which case you can use Current Page Name).

My question is more about the reason for difference between classic path determination (everything between domain and query params [?] or anchors [#]) and what we get using path option while getting data from pages URL :slight_smile:

Let’s look at another example. Something like this: domain.com/page/folder/subfolder/item

Using path all we get is just folder, all other parts (page name and path segments after folder) are ignored. So what we get is not a path, it’s a segment #2 only.