User profile determines repeating group's content

I am working on a donation app which supports the UN sustainable development goals. The user has a profile section where they can select which goals they are interested in supporting. When they click on a specific goal, their selection goes from white to color. In the user database, it also records a yes/no of their interests.

In the donor management section, admins can create new initiatives which align with these goals.

This creates a script to embed a donation link in their website. Donors who register can also view initiatives in their account. Right now in the initiatives, section it shows all funds created by the admins in a repeating group.

What I would like to see happen is to show only initiatives which align with the user’s profile. For example, if I am only interested in SDG goal #2, zero hunger, then only initiatives which the admin has identified as supporting that goal will be displayed in the repeating group feed.

Any thoughts on data and group/repeating group structure to make this happen would be greatly appreciated.

Have you tried using the :filter method on your data sources? Or you can also use conditionals on the repeating group to change the data source based on a condition.

Here’s how you do this. (I’m talking about “amenities” here, but any time you wind up with a big bunch of checkboxes, you should instead, do things this way):

@keith Thanks for linking the video. I ditched the yes/no and swapped everything to lists as you described. A user can now add their interest and it is stored as a list. An admin setting up a new initiative can select the interest areas their project falls in. These are stored as a list in the initiative the same way the user does. The list of interests are set and never change. I now need help on the last mile which is when the user view the repeating group of initiatives, only the inititatives which share sdg goals in common are displayed. I’ve tried a lot of different setups but I’m either getting an error or nothing is displayed. Any thoughts on this would be greatly appreciated.

So, I may not be understanding your question correctly, but bear with me: The way to debug / make progress with this is as follows:

  1. Ensure that you are actually pushing a list of any “sdgs” at all on to the User. To do that:
  • As your test user, go thru the sdg selection process. Put a text element or RG on the page that shows Current User’s sdgPreferences. (If sdgPreferences has no visualizable components, just display Current User’s sdgPreferences :count, eh? If it never goes non-zero, you’ve got a problem there.)
  1. Now, I think what you are saying is that you allow a user to select from the entire list of sdgs, but you only care about the sdgs that are also in some rail’s sdgGoal’s. Is that correct?
  • If so, you are interested in the intersection of the User’s sdg’s and the rail’s sdg’s.

  • The list of the User’s sdg’s that are shared by some_rail's sdgs is:
    User's sdgPreferences :intersect with some_rail's sdgGoals

  • :point_up: this will yield only the sdg’s that are in the User’s list which are also in the “rail’s” list.