Listen to changes in a records by other users?

edited June 26 in Questions
I was under the impression that I could declaratively set a model to listen for changes in records that may be happening by other users. For example, if I am work with a contact record and another person on my team is working on that same record, Skuid could "Sense" an insert, upsert, or delete action on a record and trigger an action sequence. I don't see that anywhere. Is that a thing?


Comments

  • Pat VachonPat Vachon Member ✭✭
    edited June 25
    I haven't heard of this but it would be really neat for sure. 
  • edited June 10
    I must have been dreaming, But it is a neat concept. A clone model that requires every minute but only queries records with a modified date that is newer than the time of the most resent query of the actual model being used on the page. You could easily create it yourself with skuid if you could create an action loop with a delay. Can you do that with branch logic?
  • Anna WiersemaAnna Wiersema Skuid Mod, Admin 🛠️ 
    edited June 26
    There's not a way to do this declaratively.  If you want to detect changes, we recommend setting up an additional model for the object(s) and use a snippet that re-queries that model periodically to check for changes with the source model.

    When the second model is re-queried you can set up the logic that evaluates (e.g. if the timestamp has been updated) and the actions to run.

    You can check out this page in Skuid labs for an example of what this can look like:  https://github.com/skuid/skuid-labs/tree/master/experiments/snippets/realTimeOppDashboard
    • This page uses a simple snippet that polls an "updates indicator" model periodically. If this model returns data, the user is warned that there is new data, and they can update the page as they see fit.
    • It is not wise to simply continuously poll the primary model. While the model is polling, all components connected to it are frozen (no updates can be made in the UI). Also, unsaved changes in the model would likely be discarded every time the polling action occurred. That could get really annoying.
  • Pat VachonPat Vachon Member ✭✭
    edited June 26
    This would be a very nice standard option to include for all models. The additional code to do so would fairly easy to implement. You already do something quite similar with the page builder when two users have the same page open.
  • edited June 29
    This looks great! Thanks.
Sign In or Register to comment.