Populate User [New Thing] repeating group

Hey guys,

I’ve created a profile page for my users and I’ve allowed them to create a [New Thing = Team page].

On the user page, I want to create a repeating group which contains all the team pages created by the user.

I’ve set the Type Of Content to [Team]
But, I’m not sure about the Data Source.

If someone can help that would be awesome!

Well, if a Team is created by a User (which is likely how this is set up), the list you seek is:

Do a search for… Team [constraint in popup: Created by = the user this page is about]

“the user this page is about” is probably Current Page’s User, if you’ve set this up in the standard Bubble way.

Note that if this is a page that OTHER users are intended to see, you wouldn’t use “Current User” because the Current User (John Doe) might be viewing the profile page of User (Joe Blow). Joe Blow’s page should of course show Joe Blow’s bio and Joe Blow’s Teams, not the bio and Teams of John Doe (unless of course John Doe is viewing his own profile page).

(I put the preceding note here because this very simple task of creating Profile pages seems to stump many – for reasons I cannot fathom – who fail to understand the difference between “any ol’ User” and “Current User”. Point being that the Current User may in fact be looking at their own profile page – and so Current User and Current Page’s User can be the same but may be different, of course.)

As I write this, I see that you’ve already kind of made that mistake. The source for Bio is “Current User’s Bio”. What is the point, I wonder, in showing Current User their own Bio? They must already know who they are. The point of this page is probably to show this sort of info about ANY User, so retool it in that way.

1 Like

Other than that. Thanks, my issue has been solved.

Thanks Dude!

Well, it’ll show the wrong thing, right?

Here’s how this works: The profile page should have a type. The page element should be of type User. The SOURCE for that page element should not be Current User. The source should be empty.

This will cause the page to expect a path at the end of its URL. That path is the unique ID of the User whose profile you want to display.

Any page with a type has a property called “Current page’s [data_type_name]”. If a page is of type “Foo” it will have property “Current Page’s Foo” (the Foo object this page is displaying). If a page is of type “Bar” it will have property “Current Page’s Bar” (the Bar object this page is displaying). If a page is of type “User” it will have property “Current Page’s User” (the User object this page is displaying).

The point of confusion becomes easier to understand when you consider a page of type Foo. You’d never confuse “Current User” with the Foo displayed on a Foo-type page.

It’s the same thing with a page of type User. Don’t confuse “Current User” (a metaphor for ‘the entity viewing this page’) with “Current Page’s User” (the user the page is displaying data about to some entity [which also happens to have User object that represents that entity – and we can conveniently access that data as “Current User”]).

So somewhere there is a link or the results of a search or something that can expose to John Doe a link to Joe Blow’s profile. When John Doe clicks the link to Joe Blow’s profile, the “data you send to the page” is the data for JOE BLOW, not John Doe. (In this case, “Current User” does not equal “Current Page’s User”.)

John Doe could of course also view his own profile. He might follow a link to John Doe’s profile (his own profile). The data you send to the profile page in that case is John Doe’s data. In that case “Current User” does equal “Current Page’s User”. John Doe might also follow a link or button you put in front of him that is labeled “View Your Own Profile”. In that case, you’d pass the profile page “Current User” as the data to send – that makes it easy, right?

The other thing that’s neat about this: The Profile page you’re building can be both a view page and an edit page. If User 1 is viewing User 2’s profile page, you’d make it so there’s no edit capabilities accessible. BUT, if User 1 is viewing User 1’s profile page (User 1’s own profile page), you could show an edit button near “bio” for example that either pops up an input or replaces the text element bio with a multiline input autobound to bio (or something similar – there are zillions of different things you could do).

The condition that would let you do this is “Current Page’s User” = “Current User”. That condition will be true (and will only be true) if the user is viewing “their own” Profile page.

To back up a step or two: It might be worth reviewing the tutorial Lesson on “Sending Data to a Page”. Armed with the information above, the info in that Lesson might seem more useful now than the first time you ran through it! I’m talking about this one:

on this page:

I think I see what you’re saying.

For example I want a facebook profile to be able to have it’s own url id, and allow other users to view each others profile page.

So, setting everything to [Current User] is wrong? Correct?

1 Like

Correct on both counts!

1 Like

So, I should set the Facebook Profile data to [Current Page User]? (Example lol)

Thanks so much man.

1 Like

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