I’m using a container with “Iterate Data Source” to render out a list of Posts. And I want to show (like in this forum) the count of replies tied to the post in this view. But I’m not able to make it work. I tried to set up a data source where the filter is tied to the “selected” source but that only works if you go into a post and back. But for only that post.
Is there a way to ask the data binding to use “context” instead of “selected”?
BR, struggling AppFarmer.
You can get the number of replies with the use of the function editor.
- Click on the text component you want to display the number of replies. (Make sure this is somewhere inside the posts iterator)
- In the property pane on the right, for the “text” value, click on the 3 circles and then “Function”
- In the function editor, add in your “replies” datasource with the “+” sign.
- Select the newly added datasource and under selection in the bottom right corner, select “filtered selection”
- Set up a new filter where reply.post EQAULS post
- The newly filtered datasource will now hold a number of objects equal to the number of replies for the post in context
- In the function editor write the following code to return the number:
Hopefully this will solve your problem
Awesome this worked for me. Thanks!