Data Structure For Creating a Client Side Array of Contacts

My app allows users to create a list of Contacts via various searches, and then choose a set of actions on those contacts, such as sending them an email.

I’m a bit unclear about how to create the data structure to do this.

So far I have created an array of numbers called Contact List and used Add Unique to add the id of a chosen contact to the list.

With that I have created a repeat block which allows me to display… well, with my current knowledge, only the id values!

Is there a way I can access more useful information about the contact in this repeat, or do I need to create a more complex data structure that somehow gets initialised with fields such as first_name, last_name… when I do the Add Unique?

Thanks in anticipation!
Antony.

Do you just need this additional info to be displayed on the page (just for the user)?
And on the server side you only need the IDs, right?

I guess so…
On the server side I will need the email addresses to send the emails through Postmark…

You can use the array values to filter a database query and show the results on the page, same for your send email - get the results of the filtered query.

I’m a bit unclear about the details of how to do that in the repeat, but I’ll have a play and see if I can work it out!

You just need a server action with database query, filtered by the array items.
Then you create your repeat, which shows the details on the page out of this query, not using the array :slight_smile: