Dashboard not referencing the currently logged in user

My app allows users to post events, they should be able to see the events they posted from within their dashboard.

The user dashboard should be referencing the currently logged in user and only showing the events that user posted.

The user dashboard is set to User

Search for event title

With conditional that user must be logged in:

But I don’t see how to only show events posted by this user?

Add a constraint on your search, to only show Events created by the current User.

And get rid of the conditional (you haven’t set any property to change there anyway, so it’s not doing anything).

Also, I can’t really tell from your screenshot, but if those text boxes are inside a Repeating Group (which it looks like they are) then you don’t want to do the search in the expression in the text box (unless you want every cell to show the same data, i.e. the full list of events).

Instead the search should be done for the datasource of the RG, and the text boxes should simply refer to the current cell’s data.

And on another note, there’s probably no particular reason to set a content-type for your page of User here, unless you want to be able to share a particular User’s dashboard with other users. If the page content will only refer to the Current User, then you don’t need a User content type.

Thank you, I’ve removed the conditional and the content-type User for the page. I don’t see any way to add a constraint to only show Events created by the current User. When I look through the available options, there is nothing which offers this function (see image below).

Also, the reason I used a repeating group is because I don’t know how many events the user will create? What if the user created 20 events, how do I offer enough text fields to populate these so the User can see what they’ve created?

The constraint should be: Created By = Current User

Yes, using a repeating group is the correct way to do this. The repeating group will show all of the events for the current user (unless you specify a specific number of events to load in the datasource).

1 Like

ah perfect, I didn’t know I had to include the ‘=’ in the constraint. Thank you for helping me solve this.

One thing which I noticed, the first user only posted 1 event, and the second user posted 2.

However, this generates a repeating group with 3 rows and the they are somehow connected. The user who posted just 1 event now sees two blank fields (where the other users events are) and he sees his single event on the bottom row?

Set your RG with only 1 column and 1 row. A’d check in your database that you haven’t 3 entries for this user (1 with a title and 2 with no title)

I have it set to 1 column and 1 row, but because there are a total of 3 events in the database (by 2 users) the RG seems to create 3 rows.

But… Wait… What are you trying to do?

You should set a RG, type = events, and set the filter to Created by = Current user.

That’s what I did but it shows a cell (in repeating group) for ALL groups. Granted, only the cells for the current user are populated, but the other cells are blank where they should (ideally) not be there at all.

Imagine you posted an event “Tennis on Saturday”. Now, you login to your dashboard to see how many people are going to your event, but instead of seeing your one event, you see 100 empty rows, with only one showing your event. This is crazy, I need to show the user their event and NOTHING else.

It looks like you’re doing the search inside the text box rather than the RG.

What is the RG data source?

It’s ‘search for events, title’

Ok, so you’ve got this set up all wrong for what you’re trying to achieve. Here’s how you should have it:

You RG content type should be Event

The data source should be a search for events created by the Current User

Then in the text box you just refer to the current cell’s Event (don’t do a search again inside the text box).

1 Like

Perfect, thank you! I am posting an image of the final set up so others can see.

1 Like