How to build a add friend function?

Hi All,

I am a beginner on Bubble and want to make the users connect by each other as friends.

How can I build an add friends system and show the friend list on each user? There are few questions that I’m not understand.

  1. This is my data type for the user, is it okay to build an add friend system?

  1. I want to add friend by input the username in the input box and clicking the button “Add friends” as below. What workflow should I run for it?

  1. Some videos said I need to make changes with both current user and my friends, how can I make it happen?

  2. Lastly, I want to show my friend list. How to show my friends nickname on the repeating group?

Anyone can help? :sob: Thank you so much!

Sure you can.
Your data set up looks good.

When pressing the button create workflow:

  1. Make changes to Current User
    Change field: “Friends” → Add “Input Search by Nickname´s Value”

  2. Make Changes to “Input Search by Nickname´s Value”
    Change field: “Friends” → Add “Current user”

This simple set up will however make both users friends right away.
you might want to add a “friend request step” in wich you first add the two different users to a “Friend request” data field (list of users as well).
And not utnill the user press (accept_request) they will be added to the “List of friends” (and removed from the list_of_requests)

2 Likes

Oh! that’s good. Thank you for your help!!!

HI @Kackur ,

I have some more questions.

I tried to create workflow to button “Add Friend” , “Make Change to Current User”, the field “Friend add Input Search by nickname’s value” became red as below.


Am I made any mistakes? Thank you!

You haven’t added ‘value’ to the end of the expression…

Thank you! But it’s still in red. :sob:


Then it must be a ‘type’ mismatch…

What is the Type of the Search box?

EDIT: Ah, I see you’re using an Input element for this… I wouldn’t personally recommend doing that…

But if you really want to then you’ll need to do a search for Users and match the User’s username to the input’s value.

Okay! thanks so much!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.