For an app I am currently working on, there is a requirement to support Global Announcements. The basic requirements are:
An Administrator can create an announcement and target it at a specific group of users
When a user opens the app, any new announcements will be front and centre on their dashboard
The user can view the announcement and mark it as read
Administrators can track how many users have read each announcement, and which users
Requirements 1 to 3 are easy. Just add a User Specific Boolean to the Announcements table and weāre done. But requirement 4 is a little trickier. The problem is that you canāt get at user specific data for doing things like rollups, etc. So Iāve been mulling this over for a few days, and after watching Bobās tutorial earlier today I had a sudden flash of inspiration
Here is how I ended up doing it:
Announcements are presented as an Inline List
When a user taps an Announcement, a custom action writes their UserID to a USC, and then does a View Details
In my Announcements table, I have a āRead Byā column. This is a Basic Text column, but actually contains a joined list of the UserIDās of all users that have read the announcement. This list is built dynamically as each user marks the announcement as read
I then take that āRead Byā column and use a Split Text column to create an array of UserIDās
This is in turn used to create a multi-relation back to my Users table (this provides access to a list of users that have read the announcement)
And finally, I do a rollup on that relation to get a count of users that read the announcement
Iāve put together a demo and added it to my āCommunity Demoāsā app. Here is what the demo looks like:
Note that when this goes into my ārealā app, Row Owners and Roles will be enabled, so users wonāt be able to see the counts or who else read each announcement. But I left those disabled for the purpose of the demo. Also in the demo users can mark announcements as āUnreadā. This option wonāt be available in the ārealā app.
The app is copyable, so feel free to grab it and play around with it.
Would also be interested to hear of other approaches to this, and in particular if Iāve missed something obvious and overcomplicated it (which I usually do)
Thanks!
Curious to know how you would approach this?
What I have seems to work okay, but Iām always open to learning better/alternative ways to get things done
Hi Darren, what does this step look like? I am assuming there is a custom action when they āmark as readā but I dont know how to keep adding new values (UserIDs) to a basic text field without overwriting it.
When a user taps an announcement, their User ID is written to a User Specific Column (usc-user)
Then there are 3 columns in the Announcements table that help dynamically build the list:
tp-first-user - this is a Template column that just mirrors the contents of usc-user
tp-subsequent-users - another Template column that contains the current contents of Read By, a comma (,), and usc-user
ite-new-read-by - an if-then-else column that determines which of the two templates to use when the user marks the announcement as read. If Read By is empty, use the first one, otherwise use the second one.
Then when the user taps the āMark as Readā button, the Read By column is updated to the result of the if-then-else column.
Note that my method doesnāt remove users from the list when they mark an announcement as āUnreadā (that wasnāt a requirement for my app). But @Lucas_Pires and @Robert_Petitto showed how this can be done with their āTrebuchet Methodā. If you watch Bobās video, youāll see that he explicitly covers that step.
Has anyone ever figured out how to remove a specific chunk of text from a joined list of values? (Assuming that the joined list isnāt being dynamically generated and is a static list that has been written to the sheet already)
Closest Iāve seen was @Jeff_Hager doing a bunch replacements using a blank column. But they were very specific use cases. Iāve yet to see a general solution, and I doubt that it will be possible until we get some string manipulation methods in the GDE.
Was just thinking about this. Iāve seen that a few people have also asked for Regex capability in the GDE. Whilst this would be awesome, it could be a double-edged sword. Regex is incredibly powerful, but if you donāt know what youāre doing itās very easy to write regular expressions that become huge resource hogs. I can imagine folks going to town with regex in the GDE, and then wondering why their apps are grinding to a halt. So maybe not such a good idea. But vanilla string functions like left(), right(), substr(), etcā¦ yes please!
Some days I really wish I could switch these two replacement fields around.
Sometimes I want to dynamically set the value to be replaced, and sometimes I want to just type in a replacement value instead of creating another column (especially a blank/empty column just for the replacement). Would really help to make a lot of things easier,ā¦along with a full list of string manipulation options . Iāve hit a few walls where code is easier than no-code and Iāve had to jump through a few hoops to make something work.
Do you have an example of a list and the value you would want removed? Is the value that you want removed a certain value, or is it kind of unlimited what it could be?
One idea Iāve considered is to use a multi-step action to clear the column AND write the existing array to another column that then gets turned into an inline list for them to re-select from. That would really only work for small arrays where itās not too cumbersome for the user to have to re-select the correct items.
Definitely not easy since itās Row IDs. The only thing I could think of would involve a Split Text column, a relation to a sheet that has those Row IDs in rows, and some variation of the Trebuchet method to rebuild a Joined List of Row IDs minus the Row ID you want removed to overwrite your existing joined list.
Should i just delete my post today then haha. Smh. This is what I get for not knowing lingo. The one thing I didnt type to find this yesterday was āglobal announcementsā
Will dive in today and see how I get on!
Ok done! Feel like im learning faster now So far only a couple errors as opposed to millions ha!
Very pleased with result. Not sure where the duplicate of āmost recentā announcement is coming from though. I posted about 10 msgs as a test and the most recent is always duplicated at the bottom of the inline list for some reason. I tried to reference your community app @Darren_Murphy but by actions are the same, so not quite sure.
If anyone can point me in the direction of a guide to learn how to set up my SMS/Email notifications thats my last step! Ready for this zapier beast