Hi everyone, I noticed a workflow in an app that uses “Do When This Search Is True” to trigger a notification. Essentially, when another user performs an action that updates a specific data point, the condition becomes true, and a popup notification is displayed for the user.
I’m curious about the impact this approach might have on app performance and workflow efficiency. At first, it seems like constantly running this workflow could slow things down, especially if the search is happening frequently. However, I’ve built repeating groups in the past that update in real-time when the database changes, so I’m wondering if this might work similarly.
Does the performance impact depend on how the search is structured or the size of the data being queried? Any insights or best practices would be appreciated!
store a field on the user “message unread” boolean or number of unreads
then show the notification on the page if message unread is yes
user clicks the icon to see the unread message
shows a repeating group of conversation_users (conversations this user is in)
data structure would be:
message
conversation (links messages together)
conversation_user (links a conversation to a user and also allows for this user has unread messages in this conversation)
user clicks conversation user - shows conversation with list of messages, changes conversation read to read and triggers backend workflow to check update users unread count
when new message is sent
trigger backend workflow for each of the conversation_users to update their unread counts/booleans and conversation_users
this achieves an optimal data structure since:
no searches are done on the page (user stores the unread count)
search is done for lightweight conversation_user in popout when requested and unread conversations are easily filtered
conversations and messages are loaded only when opened
Ya, that’s pretty similar to what I was thinking of suggesting to them. But I’d never done it the way they had, so wasn’t sure how big of an issue it would actually be if any.
Instead of performing an operater on a Search you can just compare the current item/list to a state. Use a Do when event when the item(or its value) and state don’t match to run your notification event and update that state.
Saves a little bit of WU from searches and this works because each data loaded on page attaches a realtime WU cost for each update already.