Trigger action on RG new entry

Hi all. I have a question about performing a workflow when I get new data added to my repeating group.

My aim is so when a new message is found in the repeating group then an air alert will display. I don’t know how to do this - any help would be appreciate.

I’d love to learn more before suggesting anything. There can be many ways of doing this. Depends on your user case.

Are you trying to build notifications?
Or when user adds a new message you want to display a success alert?

Think of it as a chat system where I am chatting live with you. When you send a message an air alert pops up on my screen and says “new message received”, this also will scroll me to the new message.

Ooh ok, one way of doing it is to save current count of RG in a Custom State and Display Alert every time the count changes. I’m not sure if this is the right way of doing this though. I’ll try to tinker with it myself and see if I can come up with a better solution.

If you fix it in any other way please share it here, so others can see it.

1 Like

Thanks - I am trying some things but still in the dark.

COUPLE OPTIONS IN PLACE

Step 1
Add Status Field to a Data Type Message.
Set Status Field Type to Text
Status will be either seen/unseen. (I’d recommend you to use Option Sets for this. By default all will be unseen. Or leave them empty and treat empty space as unseen.)

Step 2 - If you’re building notifications:
You’ll create a RG where you’ll display messages.
Set the constraint: Status = unseen. (This way only new or unseen messages will be shown here)
When notification item is clicked Navigate & Scroll to the item in the original RG. Wherever you have a chat displayed.
In the same workflow action set the status of that specific message to seen.

Step 2 - If you’re building a chat:

If you do not have anything to trigger Seen/Unseen change action then I’d suggest to do the following.

Do the step 1.
Click on the Input Message (where users should type a reply text). When you click it then go to ahead and click on Workflow tab.
Add a New Event
Choose Data (Things)
Make Changes to a List of Things > Type of Things is Message > List to Change is Do a Search for all Messages (set constraint Status = unseen) > Click on CHANGE ANOTHER FIELD > Status = seen.

I wish I had a Buymeacoffee account :joy:

Jokes aside, let me know if this helps.

Wow! Nice work - just so happens I got it working moments before you sent this message - for anyone wondering how it works in my particular use case:

  1. Upon clicking onto the specified message inbox, display the data to the main messaging view and add a wait for data change workflow.

  2. Set up a custom event that does as you specify

  3. Duplicate this custom event.

  4. Add a do on data change event to the start of both of these workflows, making sure that they trigger each other - essentially creating a loop

  5. The magic unfolds

Thanks, @bestbubbledev for the help with this!

Awesome I’m glad if I helped in any way, shape or form. Good Luck!

1 Like