How to limit messages to specific project users

Hi all,

I am building a project app and I want users of a specific project to be able to communicate to each other within their project. The message-system is all set up, but it displays messages from all projects.

Any idea how to fix this?

Cheers

You have to bind the messages to Current Page Project or Current Project.

You must that from the database table and when changing the data thing.

Thanks for your response. However, Iā€™m afraid I donā€™t really follow.
Could you expand a bit?

Cheers

Letā€™s say youā€™re doing a search for messages. You would want to put a constraint on the search by setting Project to current page Project.

You can only set that constraint if you add the Project table inside the Messages data table in the Bubble Setttings.

You need to create a new row inside the Messages table called Project and select type Project.

When you create a new Message you can select Project = Current Page Project.

Thanks!

The only problem now is that the posts by a user stay fixed, even though the project is changed.

This is what it looks like now:

You should apply it to Current Page Project. I think that should solve it.

I donā€™t completely understand the question so my answer might not be the solution.

I added the new row in the messages table called project with type project, but I canā€™t seem to put up ā€˜current page projectā€™ as a constraint.

So basically my problem now is: if user A sends a message in project A, it shows in all other projects sheā€™s a part of as well. I know the solution is in connecting the message and project data, I just canā€™t seem to find a solution.

Hope this is a bit more clear.

Cheers

I know the solution must be very obvious but not finding it is as frustrating

Iā€™d try to do it the other way. Put a db field in your project table, with messages (list of messages).

Then you can search for ā€œthis projectā€™s messagesā€

Have you gone through some tutorials? I didnā€™t go through through them, but Echo Lake and Mohammed Haashir (Kreator School) both have the foundation of messaging on youtube. @Nocodify is right it has something to do with your data setup. Faye Watson shared bits and pieces of a tutorial on this very forum. If you look around a bit youā€™ll find what you need :wink:

HOWEVER, if you did do all of the tutorials and spent the couple of hours you will need to figure it out, and you still canā€™t piece it together, drop us a line here with your editor link and weā€™ll try to set you on the right track. Thereā€™s just not much targeted help we can give you without seeing your data setup and how it interacts within the app.

1 Like

Thanks Duke. Indeed Iā€™ve gone through Echoā€™s and Kreator Schoolā€™s tutorials. I understand the foundation of messaging, itā€™s just pairing it with data from the projects that I canā€™t seem to get my head around.

Basically Iā€™m working on the project management template (Tasky). There, the user has the option of creating a new project and inviting other users. When that new project is created, I want the users of that project to be able to message each other in kind of a comment section. That comment section has to belong to that project, and change depending on the project.

I will look over the info you gave me, and keep you up to date. Thanks for the help!

Ok so as @Nocodify mentioned previously, you do need to add a field to your ā€œprojectā€ thing. You have a thing type project and a thing type message. Inside the thing type ā€œprojectā€ you should have a Field type ā€œmessageā€ and check ā€œthis field is a listā€ to make sure you can link a list of messages. Letā€™s assume again that you have a page now with a project loaded somehow (it could be a the page level, or in a group or Iā€™m not sure what your setup is). Letā€™s put in a repeating group that will load messages, and have the data type be messages. Letā€™s put the data source as PROJECT GROUPā€™S Projectā€™s messages. Then that repeating group will only load the messages that youā€™ve added to that particular projectā€™s ā€œlist of messagesā€.

Now all you need to do is when you create a new message, add a workflow saying "make changes to > PROJECT GROUPā€™s Project add result of step 1 (or wherever you created that message. Now your project should have an updated list of messages for that particular project and they should load in the Repeating group.

@nocodeventure method as you showed in your screenshot will work as well. The problem is probably that youā€™re not changing the project in the parent group correctly? I would advise against this method because itā€™s a lot more resource intensive in the search, as opposed to having a pre-loaded list of the messages associated to each project.

Thanks a lot, that seems to work! The messages are now part of one project.
The only thing Iā€™ve noticed is that other users of that project donā€™t get to see the messages. Itā€™s only the user who posted them.

First thing to check is whether or not you have any privacy rules enabled, you might be limiting messages to creator. If not, as previously mentioned, itā€™s difficult for us to check without access. If youā€™re comfortable you can set your app to ā€œeveryone can viewā€ and either post a link or dm it.

It was a privacy issue indeed. Thanks very much for your help, itā€™s working perfectly now!

1 Like

Anytime.