- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2025 04:18 AM
Ehen i click on post comments button that comment should be populate in activity stream. this is made in ui builder compose is text area and post comments is button area. how can i achieve this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2025 04:47 AM
Hi, If you want to post a comment and instantly show it in the activity stream in UI Builder, here's a simple way to do it,
Requirements:
Compose – This is your Text Area where users type the comment.
Post Comment Button – Users click this to submit the comment.
Activity Stream – This is where you show the list of comments.
Steps:
Create a View Model Variable
For example: commentText
Bind your Text Area value to this variable.Set Up a Data Resource
Use a data resource (like sys_journal_field ) to store and show comments.Configure the Post Comment Button
Add an event to this button:Create a new comment record using the value from commentText.
After posting, clear the input and refresh the data.
Example:
$data.CommentTable.createRecord({
element_id: '<record sys_id>',
element: 'comments',
value: viewModel.commentText
}).then(() => {
viewModel.commentText = '';
$data.CommentTable.reload();
});
4. Show Comments in Activity Stream
Use a Repeater to loop through CommentTable.records and display each comment.
That’s it! Now when someone types a comment and clicks the button, it gets saved and shows up right away in the activity stream.
Let me know if you want help with any step!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2025 04:47 AM
Hi, If you want to post a comment and instantly show it in the activity stream in UI Builder, here's a simple way to do it,
Requirements:
Compose – This is your Text Area where users type the comment.
Post Comment Button – Users click this to submit the comment.
Activity Stream – This is where you show the list of comments.
Steps:
Create a View Model Variable
For example: commentText
Bind your Text Area value to this variable.Set Up a Data Resource
Use a data resource (like sys_journal_field ) to store and show comments.Configure the Post Comment Button
Add an event to this button:Create a new comment record using the value from commentText.
After posting, clear the input and refresh the data.
Example:
$data.CommentTable.createRecord({
element_id: '<record sys_id>',
element: 'comments',
value: viewModel.commentText
}).then(() => {
viewModel.commentText = '';
$data.CommentTable.reload();
});
4. Show Comments in Activity Stream
Use a Repeater to loop through CommentTable.records and display each comment.
That’s it! Now when someone types a comment and clicks the button, it gets saved and shows up right away in the activity stream.
Let me know if you want help with any step!