Awesome!! No problem at all! To explain, I created the buttons “Everyone” and “Friends”.
Then I set up the workflow for the Everyone Button:
And the workflow for the Friends Button:
Current View is the custom state (Type: Text, List No), of the RepeatingGroupSocial. The only values for this custom state are: “Everyone” or “Friends”.
*When the page is loaded, the value of the Current View custom state is set to “Everyone”.
And then this conditional formatting is added to the Repeating Group Social:
Here we’re just telling Bubble that when the value of Current View (custom state) is “Friends” --> property to change: Data Source --> Do a Search for Socials, with the search constraint that the Creator of the Social must be a User who is in the Current User’s Friends List.
And then we can change the conditional formatting on each of the buttons so that they change their coloring depending upon the state of Repeating Group Social:
And that’s it! I also saw that when a new Social is created - you don’t need to have the fields ‘username’ and ‘profile pic’ within the Social data type, and can remove them from this workflow when ‘Post’ is clicked:
Instead, the dynamic data to display the Creator of the Social’s username or profile picture in the Repeating Group’s cells can be “Current cell’s Social’s Creator’s Username” and “Current cell’s Social’s Creator’s Profile Picture”. Since Each Social has a Creator by default (a User), you can dynamically display that information through that expression, without having to save it every time a User creates a new Social.