How do I set up a data source for my comments feature that automatically has the user id, name, email, photo and so on populated from my user data?

Hi all,

How do I set up a data source for my comments feature that automatically has the user id, name, email, photo and so on populated from my user data?

Would I then just add a column to this data set to save the comments in?

Thanks Simon

Assuming that your Comments are being added by a form, do the following:

  • Add a column to your Comments table to hold either the users email address or RowID (either is okay)
  • In your comments form pass either of the above (whichever you selected) as a special value
  • Create a single relation column in your Comments table that matches the user email/RowID with the same value in your User Profiles table
  • Add one or more lookup columns to fetch the user name, avatar, etc via the relation.
1 Like

Hi Darren,

When I add the comments element it does not generate a form…this is what I get to play with…

Yes, well you need to configure it.
And you need to create a separate table to hold your comments.
At the moment you have it configured to write to your Users table, which is almost certainly not what you want.

Rather than me giving you step by step instructions, why don’t you first have a go at setting it up by following the instructions in the docs:

If/when you get stuck, come back and show us where you got stuck and we’ll help you along.

1 Like

Hi Darren,

I went through the instructions and they make sense, but I can’t seem to get the ‘current users’ details to map out the details needed for the chat display?

Thanks, Simon

I’m too lazy to type…

1 Like

Darren,

Thanks so much for ‘holding my hand’ through this and taking the time, it is much appreciated and I have followed your video to the letter and it works! (but you knew that already! :rofl:)

Another question…are users able to reply, comment or react to comments posted using this element?

Cheers, Simon

1 Like

Users will be able to add further comments, but not replying to a specific comment (if you hope for a tree of comments then that’s a no for this layout), or reacting.