Noob here - How do I add a "User Subscribed" List to a Thing and then Display It?

Hello,

I’m sorry I don’t want to post for asking such a stupid question, but I can’t seem to figure out how to add users to an object. So I have a thing and I want to add a list of users to it. So other users can see the list of users interested.

So I have tried:

  1. Creating a list of Users under the Thing (Let’s say its a Chemical), the change list action recognises the User > I select add current user in the field, but have to create a new field called Users inside the “list of users”. It doesn’t work.

^ Also when I use the repeating group container, the text field won’t allow the data retrieve to be type “users”, it has to be text.

  1. Creating a list of Users under the Thing, but as TEXT. Now when I go the change list action, it only shows the two types of objects I have which is Users and Chemicals(The Thing I am trying to add users too), so there is no way to target the list unless I have it as a list of Users.

I guess in programming you would do something like convert the array into a string, but with this I have no idea how to get it working.

So I just want a list under the page of my Thing(Chemicals), the list of which users are interested in this Chemical .

This is my first time around and my communication skills are not great, so apologies for the confusing layout of the question.

So we are clear: I am trying to make a list of users interested under each different thing (e.g. event, product, chemical)

Hi @majorlegendx :slight_smile: Welcome to the Forum!

Definitely not a stupid question, it sounds like you’re really close. If you have a Data Type called “Chemical”, you can create a new field under it called “Users” (type: User, List: Yes). Then use the Make Changes to a Thing, Thing to Change: Chemical, Field to Change: Users add Current User (or whichever User is relevant here).

The error message in the repeating group is pulled up because you need to select a text field, right after selecting the User Data Type. For example, the dynamic expression could be “Current cell User’s email”. Email is a text field, so that would display correctly. Alternatively, you could create other fields such as “First Name” (Type: Text, List: No), “Biography” (Type: Text, List: No), etc.

Are you trying to display the Chemicals, with the list of Users associated with each Chemical in a repeating group? If so, you would set the type of content of the RG to “Chemical”, Data Source: Do A Search for Chemicals. Then (there are a few ways to do this) but you can have the Users field (Type: Users) within the Chemical data type, your text element in the Chemical repeating group to show those Users could be “Current cell’s Chemical’s User’s First Name”.

However, this isn’t a very flexible solution since all of the Users first names will just display in a long paragraph separated by commas. Instead, you can place a second repeating group inside the first cell of the Chemical RG. This would be a nested repeating group which displayed Users associated with the Chemical. The Type of Content would be User, and the data source would be: “Current cell’s Chemical’s Users”. Then place a text element within the first cell of the User RG, with a text element such as “Current cell’s User’s first name Current cell’s User’s last name”. This way, you can easily display the full names (and any other dynamic data, such as a profile picture) associated with each User who likes that Chemical.

This is probably a lot of info at once… :slight_smile: If any of this is unclear, feel free to share a link to your app in the editor (set to public) and we can definitely help you get this set up!

Thanks for this answer, @fayewatson (and thanks for the question @majorlegendx).

This has helped me think differently of a question I have (link).

I am now doing as you mentioned, Faye; I’m adding the user to the Chemical Thing (mine is called Fiberhood instead of Chemical). That works.

I can now sort the list of Fiberhoods by the count of users. :tada:

Question: I already had some data. But it was “reversed”: Users were part of a Fiberhood. Is there a way to have Bubble do a search for the Users are part of a Fiberhood and then add those users to those Fiberhoods?

No problem, @rico.trevisan! :slight_smile:

For your app, it looks like there are 7 Users who have a Fiberhood field that isn’t empty. Just to double-check, you want those Users to be added to their Fiberhood’s list of Users field? Or something else?

Yes, that is correct. Users who have a Fiberhood that isn’t empty --> to Fiberhood’s list of Users field.

I am asking this because I believe it will be a skill/tool I need in the future. Here is how the business works:

  • Users register
  • We then create a Fiberhood (if there’s enough demand, technical feasibility, etc.)
  • at this point I would like that newly created Fiberhood to add to its list of Users, those Users who were registered.

Got it :slight_smile: Which page contains the workflow where a new Fiberhood is created?

:+1:
the page “capturando demanda”

Hmm, not sure if I am missing something? (Let me know if I am! :slight_smile: )

It looks like you already add Users to the Fiberhood’s Users field on the Assine page:

But you’d like this to happen at a different step in the app?

Yes, it does NOW after I read your post. :smiley:

There are 2 flows.

  1. The Fiberhood exists
  • Fiberhood doesn’t exist.

Flow 1 is the one where I am using your answer, the one you see above. A Fiberhood exists, users selects its, signs up, and then the user is added to the Fiberhood’s list of Users. So that one is solved. :white_check_mark:

Flow 2 is when there’s no Fiberhood created and anyone can sign up. After enough people sign up, we create a Fiberhood. At that point, I would like Bubble to add those previous sign-ups to the Fiberhood’s list of Users.

Ah, got it! :slight_smile:

For Flow 2, Users submit Surveys. If enough Users submit Surveys requesting a Fiberhood, you create one? If so, I would add a field modification when creating a new Fiberhood which is "Users add list Do A Search For Users (constraint, endereco = Input Fiberhood’s endereco). Considering the address of a Fiberhood would be the same address as any Users who have requested it?

1 Like