Accessing / Modifying the comment threadid on the new comment thread

Hi,

I am using the new comment thread for a few months now,
for threadId i am using an internal id from my database

i had to refactor my app and move it to another database and as a result , the ids which used for the comment thead - changed.

Is there a way to edit the already entered data and thread id , or at least access it ?
Because now my comment threads are displayed on wrong rows

Thanks

2 Likes

hello @idan_cohen

After the recent database migration, we're encountering an issue with our comment threads. The threadId values in our comments table no longer match the new database IDs, causing comments to display incorrectly.

The most efficient solution is to directly update the threadId in the database using a SQL UPDATE query with a mapping of old to new IDs

UPDATE comments
SET thread_id = new_ids.new_id
FROM (
    SELECT old_id, new_id
    FROM id_mapping_table -- Replace with the actual name of your mapping table
) AS new_ids
WHERE comments.thread_id = new_ids.old_id;

here is the SQL update Query

5 Likes

Thank you for your reply! @WidleStudioLLP

The comments table is a retool internal table ? where is it located?
Couldnt find it in retool database

2 Likes

Hello @idan_cohen

I apologize for the oversight. I forgot to mention that you can use the internal table.

Unfortunately, Retool does not currently offer a user-facing method to access or modify the internal thread IDs for comments.

However, you can create a JavaScript query to retrieve the ID of the old commentThread1 component.

Here is a JavaScript code snippet to assist you:

let threadIds = commentThread1.data.map(comment => comment.id);
return threadIds;

Let me know if you need further assistance!

Thanks.

5 Likes

Sorry for being unclear:

  • i am using only the new commentThread
  • for thread Id i use my internal invoice id
  • i moved to a new database and my internal invoice id has changed
  • Is there a way for me to update the previous comment ids or at least get access to them?

Thanks

Hello @idan_cohen,

If you do not have the old thread ID, unfortunately, you will not be able to access it. As mentioned earlier, Retool does not provide a user-facing method to access or modify internal thread IDs. Since you're using Retool's new comment thread feature, the threads are stored within Retool's infrastructure, not your database and direct access to the underlying data is not available.

Your best option is to rebuild your comment threads with new IDs.

Thank You.

4 Likes

Hello @idan_cohen,

Yes @WidleStudioLLP is correct. If you have a self hosted instance of Retool, you would have access to the database table where the old comment IDs are stored.

It sounds like you are on the cloud and unfortunately these tables are not exposed to end users for security reasons. Our apologies for the confusion.

1 Like