Restrict user to send message to other for 24 hours

I am doing an app to users send acknowledgments to others, but i want them to send only 1 per day to the same person.

I know i need to block this action for 24 hours, but how can i do it?

Allowing a user to only send one message per day is not the same thing as restricting them from sending another message for 24 hours after having sent one…

But in any case, whichever of those two things you actually want to do, you’ll just need to add some conditional logic (either on the workflows or the UI elements) to not allow users to send a message when a certain condition is true…

If you want to restrict users to sending only 1 message to another user per day, you can simply add a condition to do a search for messages to the particular user, sent within the current day, and if the count is zero, allow them to send a message… if it’s more than zero, then don’t…

If you want to restrict users from sending a message for 24 hours after sending the last one, the condition will be based on a search for messages sent to the user within the last 24 hours.

I tried this way, is that it?

No… you’re doing the search wrong…

Currently you’re searching for items created at the exact same millisecond (i.e. ’ Now’) you’re searching for them… which won’t be any (so the count will be zero, and the condition will evaluate to false)…

As I said above, you if you want to let users send one message per day, then you need to search for existing messages sent within the current day (i.e. sent date > current date/time: rounded down to day). If you want to restrict a user from sending another message for 24 hours, then search for messages sent within the last 24 hours (i.e. sent date > current date/time: plus (hours): -24)