Hello! I have an app where I allow users to create a “guest list” from the contacts on their phone. I display the full list of contacts, and allow them to select ones to add to their guest list.

Today, as they tap each one, I create a thing in the database so I know which people have been added to their guest list. The problem is that it is sometimes slow waiting for the thing to be created behind the scenes, so it takes a few moments for the UI to respond which feels sluggish.

I’d like to instead just add guests to a custom state as they select/deselect as this is much faster in the UI, then once they’ve built their list I’d like to create a list of separate items in the database from this custom state list.

I’ve tried a “middle of the road” solution where I add to a custom state + create database item as contacts are selected to add, and in the UI I tell it to show selected when it exists in database or in custom state, but the problem with this is that it is easy for them to get out of sync and it creates some messiness.

Has anybody done anything similar to this in the past? Any suggestions would be greatly appreciated!

1 Like

What if you did the following: instead of modifying DB right away just store the selected items in the CS. In the UI add the button called Create Guest List. When the button is clicked pass the list of CS to a Backend Workflow that will create DB items for each of the list item?! :eyes:

3 Likes

That did the trick! Thank you :raised_hands:

1 Like

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