How to get new data in group, when user performs an action

In my application there is a group on the home page and I would like there to be a new thing to display in the group every time the user clicks yes or no option for the Current thing in the group.

E.g. - each group shows fetches one user from the database, and the current user would be able to accept or reject the user visible in the group. Either way, once the user clicks accept or reject, I want the group to display the next user from the database… so on so forth!

But how do i get the group to display the next individual on clicking accept or reject?

Any help will be golden

Not sure how you have your database configured so let’s start there. Based on the info you’ve provided so far, I’d set up the following:

User (data type)
Accepts (list of users)
Rejects (list of users)

Then, in the group “Do a search for” Users where current user is not in User’s Accepts or Rejects. Every time a user selects Accept or Reject for the user displayed, current user gets added to the applicable list for that User.

You could also do it the opposite way (depending on the rest of the flow in your app) where Accepts and Rejects are saved to the current user. Every time the current user selects Accept or Reject for the user displayed, the displayed user gets added to the applicable list for current user. The in the Group do a search for user who are not in either list for current user.

To clarify, you should use a repeating group instead of a group for this with one column and one row depending on how you want it displayed. This would display one user at a time and update as users are accepted or rejected.

Brilliant! Thank you so much for your help!!!

1 Like

You’re welcome!

This topic was automatically closed after 70 days. New replies are no longer allowed.