Hi everyone! I’m trying to implement a simple feature where logged-in users can mark an announcement as “read.” However, I’m encountering an issue with the Action Button. It only allows me to update the connected “Read by” field, which overwrites the existing value instead of adding the user to a list. Does anyone have suggestions on how to work around this?
Hi @Marcin,
It won’t be easy to troubleshoot via the forum without knowing your app setup. If you haven’t already, I would suggest reaching out to our support team for help with your action button. They will be able to take a look at your app and help troubleshoot this! To reach out to them, you can submit this form here: Create Support Ticket. They will be happy to help!
In case this could be of any use to you, here is our article on Action Links: Using Action Links
Marcin - If I’m getting the gist of what you want, you likely need another table that is an instance of an announcement being read. It would be a child table to announcement (one to many), and contain variable information such as Date Read and the User that read it and of course what was read. Then when it is marked as read, the action button would insert a related child record capturing who and what was read. Then, calling up a user’s detail page, you could see everything they read. And for the announcements, you could count how many times an item was read. … Something like that.
@Marcin,
As Les said, it’s hard to know how to start without first seeing how your app looks. I’d definitely recommend some screenshots of your Announcements view.
Will users only see Announcements they haven’t read yet, and when clicking ‘mark as read’, will the announcement disappear from view?
Dave’s method is the best native way to log who read an announcement. The only missing piece is it won’t indicate to the user that they have already read that announcement.
My suggestion is some JavaScript code that:
- On render of the announcements view:
a. For each annoucement record found
b. Get the current read by connection field users
c. If the connection contains the logged-in user, then hide the record
d. If the connection does not contain the logged-in user, then keep displaying the record
It would look a little like this:
Thank you all for your responses, and apologies for the shortcut in my previous message. Here is the structure of fields in the “Announcements” table:
The “Mark as read” button simply needs to add the logged-in user to the “Read by” field, which is a Many-to-Many relationship with the Accounts table. Ideally, the button would hide once the user has been added to this list.