Adalo Chat App Template - How to Remove Duplicate 'conversations'

Hi guys

So I’m trying to make a minor modification to the chat app template.

In the app, when I try to create a new conversation by clicking on ‘+’ icon, I’m directed to the ‘Start conversation’ Screen. I see a list of all users - including myself - so I filter the list by removing the logged in users email.

Trouble is the list also populates all users with whom you have already created a ‘conversation’. Also, when you click on a user with whom you have a pre-existing conversation, a set of actions get triggered (which are visible on the group 19 component) which create a brand new conversation.

So you end up with multiple ‘conversations’ between the same two set of users. Need to avoid this.

Ideally I would want

  1. to hide the list of users with whom you have an existing conversation
  2. if that user is selected, to redirect using conditional actions to a screen which shows existing conversation & not create a new one

I’m going to use the schema notations straight from the template app for simplicity.

The filter for both (I think) is to not display any user who is a part of logged in user-> conversations (member)s -> user … using any property like current user’s email, username etc to check. Rather display all current users as long as current users-> conversation (members)s-> all does not contain logged in user email.

Trouble is I can’t find this filter at all in the ‘list’. I also cant find this filter in the conditional action to redirect to a different screen.

Is there a way to implement the filters correctly to accomplish what I want - either in list of users or in screen link conditional actions? I don’t think controlling list visibility comes in to play, but do enlighten if I’m wrong.

Thanks.

This issue was posted over a month ago and the Adalo team are on the case.

Thanks Arun. I didn’t know about this topic.

It may have been a bug when the template was made, but as I mentioned at this stage a few months later it should have been possible to resolve using some filters (even if different from what I suggested).

Is it possible to find a work-around without Adalo teams intervention, as they might be working on a different set of priorities?

Well, since Adalo team said they’re working on it, I didn’t try to figure out a workaround. I proceeded with other parts of my app.
I suppose I’ll have to figure it out if Adalo doesn’t sort the matter out in a few weeks.

Anyone found a solution to this?

When showing the list of users to start a conversation with:

  1. Have the list be a custom list
  2. Group the elements that make up a list item
  3. Change the visibility of that Group so that it is
    only visible if
    The Logged In User > Friends > All
    Does Not Contain
    Current User
1 Like

I created a new app using the template after your message.

The template app as is doesn’t have any actions for the ‘Friends’ relation, which may be the bug.

But I get the general concept now -

  1. Friends is a M:M relationship within Users
  2. when a user initiates a new conversation with a new user in the ‘Start Conversation’ Screen, along with the set of actions present in the template, both the initiating user & the newly selected user should be updated by adding each other to their ‘Friends’ column (these actions are currently missing from template)
  3. then apply the filters as you mentioned.

I think that should work. Let me know if I’m wrong.

Pardon me if am wrong,

i think the issue here is how to continue an existing conversation and how to prevent a double appearance of a conversation.

Let me use the example of my app:

An admin views a list of people he can chat with. He/she selects the person with whom they want to talk with.They then are directed to a screen where there is more information about the person. They then click a button to message the person and the database creates a new conversation, adds the two users (Current user + Logged in user) and then links to the chatting inbox .

There are few options for this:

  1. In the chatting inbox,filter the messages so that it appears like the conversation exists to the user.
  2. Create two buttons and toggle their visibility; one to show when the conversation exists (Link to the chatting inbox and populate the list with the messages from both two users) and another button to show if no conversation exists between the two users (chatting inbox appears empty)
  3. Create a true/false field in users and toggle it once a new conversation is created. Then add a filter to 2 above

But i have tried and none seems to work. If only there was a way to control the creation of a new conversation each time, i,d be very far :no_mouth: :no_mouth: :no_mouth: :no_mouth:

Help guys!

Hi Caleb

The reason for me initiating this thread was to talk specifically about the standard template, so everyone is looking at exactly the same database, actions, screens, etc.

So within the context of this standard app template, what Ben has suggested has worked. I have implemented the changes - with a few minor visibility filter modifications, and adding current user + logged in user as each other ‘Friends’ in new M:M collection column - and can confirm it works.

The way you want to implement your User Flow + UX sounds like it should work in theory. I’ve not implemented your logic or seen your app, so I can’t say why it doesn’t work. Perhaps you can share a video of your app (via loom etc) & others can help.

https://previewer.adalo.com/5e449fae-7de5-4278-93f7-0dd8782aeb4f

Hi, this is a dummy of the app maybe you can explore

Everytime you click the chat with user button, it creates a new conversation, adds both users and creates a read status.
Is there a way ican control the creation of conversations such that if the conversation already exists, it shows the conversation messages and if the conversation does’t exist, it creates a new one.

1 Like

Bump this please. Is there a known solution to this? Seems like the chat template has been out for a while. Even @pford’s Instagram Clone does this as well.

This being:

“Everytime you click the chat with user button, it creates a new conversation, adds both users and creates a read status.
Is there a way ican control the creation of conversations such that if the conversation already exists, it shows the conversation messages and if the conversation does’t exist, it creates a new one.”

Yes actually there is a solution for this although it is not an elegant one. I’m working to update the Instagram course to fix this issue. Basically you have a list of conversations that shows only the conversations between you and that user(s). The conversation is shown as a button identical to the one that creates a new conversation however the visibility is determined by the count of the conversations you share between you. If it’s less than 1, the button for creating a conversation shows. If it’s 1 or more, the list of conversations shows with only one item. Clicking it takes you to the current conversation.

5 Likes

Amazing - thank you Patrick. You’ve been an inspiration and I’m currently building my dream app in Adalo now because of your fantastic teaching on No Codery @pfordmedia

@pford I’ll be waiting to preview your changes.
@Ben
…is there a way we can fix without having the conversation lists?

Sample use case:

https://previewer.adalo.com/5e449fae-7de5-4278-93f7-0dd8782aeb4f

Can i toggle the chat button here so thati have two, one which creates the conversation whenever the conversation does not exist…and make it visible whn no conversation exists

Or
A second button which connects to the chat inbox with messages of existing conversation?

Video recording here

found a soluiton. Thank’s so much for this pford

@pford

You sir, are a GENIUS! :raised_hands: :raised_hands: :raised_hands: :grin:

Hey Ben and @pford ,

I am trying to do the solution you mentioned on the Chat template but somehow I am not seeing the "Current User’’ to be selected.

Hmmm. Are you linking to this page from a list of users somehow?

Hi - How exactly did you count the number of conversations between two users, apologies for the dumb question its been a long day!