Comment on pictures

Hey everyone,

I made a Facebook like social network for internal use only.
I am trying to add a feature to allow users to comment on individual pictures within a post.

Currently the Pictures are uploaded to the post as a list of images, I can’t figure out a way to attach a comment to a specific image in the list. So I thought a better way would be to add a new data type that has fields for the image, the comment, and the post that it’s a part of. Then I can use a backend workflow to create a new thing for each image.

I setup an API workflow that triggers when a post is submitted that creates a thing for each item, but my issue is the backend workflow is adding the same image to each thing.

See below:
The backend Workflow

Screenshot 2023-08-15 at 5.59.42 PM

The frontend Workflow
First I create the post:

Then I run the API workflow:

I tried setting Pics to the first item but that adds the same image to each thing

Screenshot 2023-08-15 at 6.06.29 PM

Any ideas would be appreciated.


Comments should be their own data type

Pictures should be a list of images as a data field within the comment

Posts should have a data field that is “list of comments”

Load this list of comments into a repeating group underneath the post.

Load the list of images as a repeating group inside of the repeating group of comments.

If you really want to trick things out, add a draft mode so that you can auto-bind the comments and that way, automatically save and upload images as they’re selected.

Draft Mode Setup:

When a user taps the comment icon, run a conditional workflow that only triggers when current users draft_comment is empty

Draft_Comment = A single comment field located on the users profile data type

If users draft_comment is empty, the workflow will create a new comment.

Step 2 of this workflow is to show the input comment group.

The data type of this group is set to current users draft comment.

All input elements within this group can have auto-binding turned on. If the user accidentally closes your website, the contents of the comment will have been saved.

When the user clicks “share” you’ll run the workflow, “make changes to current user” and you’ll set the current users draft comment to empty.

Conversely, you’ll make a change to the parent groups comment. Even though the text and image content is already saved, you’ll still have to toggle a draft_mode field on the comment itself (just in case you want to allow users to edit comments later)

You’ll also want to assign a post to this comment and//or you can assign the comment to a list of comments as a data field underneath the post data type.

That’s right. And each comment should have a field for your new data type (which will allow you to display comments next to their relevant image).

Where you have the red text, you should put ‘This Image’ (because you’re scheduling it on a list, and the image you want to send is this i particular image from the list) That’s seems to be the only issue :slight_smile:

Data type:

Pictures - List of Pictures
title - text
content - text
Poster - User

image - image
Post - Post
caption - text
Poster - User

Picture - Picture
Post - Post (which will always be the Picture’s Post)
Commenter - User

1 Like

Thanks for the help.

I was able to be the backend workflow to add each image to the database as a separate entry.
I have three Data Types dealing with this. Posts, Pictures, and Image_Comments.

In Posts I have a field Pictures that is a list of pictureses. In Pictures I have a field Post that is the Post its is a part of, and I have a field comments that is a list of Image_Comments.
In Image_Comments I have fields for both Posts and Pictures.

Now my issue is when trying to create the workflow to add a comment to an Image I can’t figure out how to specify that particular Image. I am displaying the Pictures in popup with a Repeating group that only shows one cell at a time, then I have arrows that will move to the next page to scroll through the Images.

So when I am setting up the workflow to create a comment how can I specify which Picture I want to attach it to?


:item # (Repeating Group’s Page Number)

If RG is on the first page, it’s picture number one, if it’s on the second page it’s picture number 2, so item # always equals RG page number in this scenario :slight_smile:

OMG I feel dumb now.

Thank you so much that was driving me crazy!

This topic was automatically closed after 70 days. New replies are no longer allowed.