Hi, I have a list of notifications. A user receives a notification, when somebody commented his post. When he clicks on “Zum Post” he gets to the screen which contains the current post with this comment. (picture 1)
Know I want to sort the repeating group of comments (picture 2) so that this specific comment, on which the user clicked “Zum Post” is at the top. When another user comments this post and the creator of the post clicks on “Zum Post” again, there should be this comment on the top.
This isn’t really sorting, it’s more like “injecting a Comment in front of a list of Comments”
@Jakob1 when they tap on the notification, is it another page it goes to, or just hides/shows groups?
You can have a custom state with the type Comment. Then your repeating group source is [your custom state]: converted to a list merged with [your current data source]
So it always puts the custom states value 1st. Then you just need to fill in that custom state with the relevant comment.
If it’s on the same page you can just use the “Set state of an element” or if it’s another page you can send the comment as a URL parameter, then on the Comments page you set the state on page load to that parameters’s Comment
You know what, just add the URL parameter’s comment directly instead of the custom state and see what happens.
This would be your navigate workflow from the Notifications page:
“sc” for Selected comment, but you can name this whatever you want as long as it’s the same in your page action and the source. User’s will see it in the browser URL bar.
The actual thing to type is “Get data from page URL” but Bubble renames it once you type the parameter name like in my screenshot.
Do you maybe know if it is possible to color this comment. So the cell of the comment of the notification should have another background than the other comments.