Adding users to chat (Xano Database)

Hi I have just recently upgraded to teams premium for the xano integration function. I am trying to make conversations and add random users to the conversation but when i use the update conversation action, there is no way to “add” a user to a conversation, it only allows me to change what conversation users = to.

similarly, if i were to create a relationship in xano from user to user as friends. I am unable to update the user to add a selected user as the initial user’s friend.

lastly, how do i call the profile picture of a user. I couldnt select it as image source even though database has a picture component in user.

Anyone knows how to solve those?

So you have conversations table and inside it, you have an array of users i guess.

Relationships work quite different with Xano-Adalo, you need to set things up to work as you intend.

A great way to do this is to have conditional logic on Xano on the UPDATE endpoint. After the initial update conversation in your function stack, have a conditional like this:
if input.conversation.created_at = ****ADDUSER
then update conversation > users = conversation.user APPEND input user ID.

To break this down a bit, what we are doing is from adalo, we send some text ****ADDUSER in a field that we are never actually updating, but then using that input to trigger conditional logic. Even cleaner would be to create a new field called ‘action’ which you purely use for this kind of thing. Also ****ADDUSER is just something i made up, call it anything that makes sense to you, the **** at the start isn’t necessary.

With profile picture, the source should be URL, and you can then choose current user > profile picture >url.

It takes some getting used to the integration but it’s powerful when you figure it. Feel free to book a consultation with me if you need some help getting going.

1 Like

Thank you so much. Will try this out.

Do you know how to save the picture to Xano database? I try to save via url and it says action not completed.

On the main update action in function stack, disable image field.

From Adalo send the image>url from image picker in the image field of the update action. Have a second conditional if image input is not empty. Inside this conditional, use ‘Create Image Metadata’ function, using URL as input. Then the output of that function can be used to update user> profile_image.

1 Like

Thank you!

1 Like