Sure thing! There are a few different ways to set that up, but I would probably recommend having the Comments and reply Comments be the same data type (e.g., “Comment”). Then, you can add two fields to the Comment data type in order to store that Comment’s “Replies” (type: Comment, list: yes), or the reply Comment’s “Original Comment” (type: Comment, list: no):
Back on the page, the repeating group of Comments’ data source would first search for the Comments where the “Original Comment is empty” (i.e., display all Comments that are not ‘reply Comments’). And, the “Original Post is the Current Page Post” (or the ‘thing’ that the Users are commenting on)
The repeating group also needs a ‘nested’ repeating group within the first cell, which displays all of the ‘reply Comments’ and contains an input group which becomes visible when “reply” is clicked in a cell:
Additionally, the nested repeating group for reply Comments is hidden by default, and only becomes visible through the conditional:
The input and reply Comment’s post button are also contained within a group that is hidden by default; it only becomes visible when that cell’s “Reply” button is clicked:
(hidden by default and set to collapse in height when not visible)
(visible when reply is clicked)
For example, if a User wanted to reply “Yay!” to the “First comment! Woo!” original Comment, the workflow would first create a new Comment thing which stores “Yay!” as the new Comment’s text, and stores the Parent Group Comment as the value of the “Original Comment” field:
And the second action would add that new reply Comment to the Parent group’s Comment’s “Replies” field (i.e., the Original Comment):
In app data the original Comment and the newly created reply Comment would look like this:
Note: In the above screenshot, I have the original Comment and reply Comments’ primary fields set to “unique” id, but changing that to the Comment’s “Text” field allows you to see how the Comments are stored:
I added another group and input to allow for standard Comments in reply to the Current Page Post, so the overall setup will look something like this
Preview:
Editor:
Preview link:
Editor link:
I know there’s sort of a lot of little things to keep track of and setup in regards to conditionals and placing the repeating group inside of the repeating group – feel free to let me know if you have any questions!