Extract text from URL from destination page

I have a page in my app that doesn’t have a type of content assigned to it. I purposely left it blank. From my main page I use a link to send text data to a new page that opens when I click on the link button.

Based on Bubble’s manual this is acceptable:

Data to send
Define what data should be sent to the linked page. This data should be of the type of content of the destination page. If you’re building a profile page which has the type of content ‘user,’ send a user to that page. The Composer will be red until the type of data is the proper type. If the page doesn’t have a type, you can send text instead to append a path to the URL.

My question is how do I extract that text value from the the URL on the new page? In my case the link looks like this (munchcode is the destination page):

https://testmunchappnew.bubbleapps.io/version-test/munchcode/amys-kitchen-chinese-noodles-veggies

How do I easily get the “amys-kitchen-chinese-noodles-veggies” text value? Do I have to use regex?

Thank you

This URL:split by / :last item

Might also have to add after that :split by ? :first item to remove any additional URL parameters if you have any :+1:

1 Like

Thanks! After some thought I think for SEO purposes I may build the URL a little different sending info the parameter route, as you elude to in your last response with the “?” separator.

1 Like

Yea URL parameter would be better, easier to extract the value too by doing Get data from page URL

You can just get the path directly from the URL using get data from url…

No need to use query parameters….

1 Like

Yup! That did it. Much appreciated.

My issue initially was I didn’t click on the pulldown button to expand beyond parameter to expose ‘path’ and ‘path segments as list’

1 Like

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