Understanding Page Data Sources in Bubble.io
What's the best way of allowing your user to, having viewed a list of your contacts, click on a contact and go through to a page that displays information on that single contact? Here we have my table and I'll just show you how my data is set up. We have a data type of contact and it's all laid out in a repeating group that searches contacts.
Setting Up the Profile Page
I also have already got set up a page called 'Profile' and this is the key bit for this lesson. If you're not using this, you're probably using some much more cumbersome way of sending data from one page to another. If you're wanting to display mainly a single data type entry, then the best way, at least in my opinion, is to set on the page level the type of content. This tells Bubble that this page is going to show a single contact entry.
Connecting Pages with Built-in Bubble Features
The way that we connect up, we don't have to send their own parameters, we don't have to work with the unique ID for each contact. Bubble has it built in. Let's go on the contact name. When the contact name is clicked, we navigate to 'Page' and we navigate to 'Profile' and it's going to add an arrow. Because I've said that that page is going to contain a contact, that's what it's going to be populated with, it means I have to send a contact through and so I'm saying send current sales contact.
Common Mistakes to Avoid
Something that I often do by mistake is that if I'm duplicating pages in order to save time in my design process, I will then end up working with a page which hasn't got the... let me show you. I've really built up this page and I wanted to duplicate it to incorporate design elements into other pages. When I duplicate the page, it's going to continue to assume that the page is intended to display really a single contact. And then I might get errors coming up in the debugger because I've left that in there.
Customizing URL Parameters
You can also select 'Name' because that will add it to the URL. Let's see what that has done. I click on 'Tony' and you can see it takes me through to 'Profile'. If you're interested in how to change past the link, it gets it from up there. That's what has 'Profile' there, slash 'Tony' because I said to put in the name, and then hyphen and then this is 'Tony's unique ID' in the database. But I've not had to extract that at any point because by using the workflow in navigation, the navigation step, go to page profile, data to send, then it means that I don't have to deal with the unique ID.
Advanced URL Parameter Usage
A few things to comment on here, in case you're interested, send current page parameters that would send if I go back onto my list page here, if I'd already stored additional values as parameters in the URL, then it would pass those onto the next page. If I wanted to add additional values, for example, say I wanted to have 'new user' and then 'yes'. That means that if someone is to complete this workflow and then they arrive on the page, the profile page, it adds that parameter to the URL.
Utilizing URL Parameters for Conditional Workflows
So what that would allow me to do, hypothetically, as building something that used this recently, that's what's on my mind, is I can do a page, pages loaded, and I can do 'only when get data from parameter new user is'. Yes. So that then allows me to dictate whether a workflow is run or not based on if the parameter is in there, based on if the user has followed a particular link or not. So I hope you found that useful, and hopefully that will save you some time in the future.