Skip to content
Advanced
Storing lists in contact data

Storing lists in contact data

It is possible to store lists of informations in the contact data. This is useful for example to store a list of projects a contact is involved in.

To do this, pass an array of values as the value of the field. Plunk will automatically recognize this field as a list and store it as such. You can use the individual values in this list when filtering contacts in the advanced campaign selector.

await fetch('https://api.useplunk.com/v1', {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer API_KEY", // Put your API key here
    },
    body: JSON.stringify({
        "event": "new-project",
        "email": "hello@useplunk.com",
        "data": {
            "projects": ["Plunk", "Plunk API", "Plunk Marketing"]
        }
    }),
});

Consuming a list in a template

Consuming a list in a template is as easy as using a single value. You can use the normal {{field}} syntax to access the list. Plunk will automatically return the list formatted as an unondered list.

Hi there!
 
This year you have been working on the following projects:
 
{{projects}}