Select specific contacts from a collection and send message

Hello everyone, I have a situation in my App that needs a way out.

What I want to do: select contacts from a collection called “Audience”, to send a message via WhatsApp (via an integration).

This action needs to be recorded for future queries (There is a collection called “Reports”, for this purpose).

At the moment the closest I got to a solution was creating a custom list
based on the “Audience” collection and add a “+ Add” icon, whose action is to create a contact in a collection called “Contacts”.
To prevent duplication of contacts I created a Boolean property called “Selected” inside the “Audience” collection. When a contact is created, “Selected” is changed to true. Furthermore, the “+ Add” icon is disabled, through a condition (This condition takes the value of the “Selected” property).

But suppose a contact was added by mistake, how is it possible to change the “Selected” property to false?

Is there a much easier way to do this?

Sorry for the big text.

Thanks

Hello, you can change it the selected user to false by replacing the icon by a (Toggle) component where you can enable or disable the selected contact.

Thank you!

Unfortunately, this cannot be done, because if the toggle button is clicked several times, several lines will be created with the same contact. The toggle should be disabled after clicking.
Thanks for the answer

I suggest to change your design a little bit.

  • Replace the icon by a Toggle Component, link the to “Select” property
  • Add a Create Contacts button that will create a contact for each selected Audience. After the Create Contacts button is hit, link back to antoher screen or disabled it with conditions.

Hello, yes I understand. You can then make the Toggle component sometimes available. so in that way it cannot be clicked multiple times.

Thank you!

Hi Amber, I like the suggestion. I didn’t know how to use toggles correctly, now I understand.
But I still have a problem, the button to create the contact doesn’t have the audience data, so I can’t put a condition to create only the selected contacts.
I tried to make the create button as list, but the system only recognizes and copies only the first contact in alphabetical order.

what could be going on?

Hi Ali-Bazzi
But in case a contact was selected by mistake, I need to be able to deselect the contact from the audience and delete it from the “Reports” collection.

Let me know if this is close to what you are trying to do (try the app and then clone it to understand how I setup things. If you have questions, I am still near).

Hi Amber,
Thank you very much for the model you sent, it seems very close to what I need, but I’m a noob in Adalo and I need some time to understand what you’ve done.

I found this model very beautiful and well built. If you allow me, I would like to use it as a basis to make something very similar for my use.

I will study this model to understand it and, probably, be back soon to clear up a few more questions.

For now, thank you very much for your help.

Admins, please don’t close this tópic yet, I’ll probably need some help soon.

You can use it as you want :-).

1 Like