Random chat in adalo

is it possible to create a random chat with a rondom user in adalo?

Hi @Liorxzr,

Welcome to the forum!

As for me, this is quite possible. To select a random user, you can do one of the following:

  • add an “ID” field to Users collection. Upon each user creation, set this ID as Users->ID->Maximum+1. Use RAND(1,Users->ID>Maximum) function to get the number for the random user, and then start a conversation with that user (via Users list + filter by this number).

  • generate random ID, use custom action to get the User by internal ID, get email out of this custom action and start the chat with this user (via Users list + filter by email).

Potential downsides for these approaches: (a) you can start chat with yourself and (b) you need to be sure that there are no “empty spaces” in IDs and they increase sequentially (1,2,3,…). So users should NOT be deleted from the database.

There is also a “Random Picker” component in the Components Marketplace. As for me this could be one of the best choices: you can use it to have the random user selected automatically, and then do all the routine to create the chat. Also you can filter out Logged-in User from the selection, along with the already existing chats (using filters). Though this component might require some time to explore how it works.

Best regards, Victor.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.