great question! Caleb here from Zapier Engineering.
I think the question comes down to what you're looking to achieve. Lists are great for static fields that users would like to specify multiple values for. Take Trello card tags, for example; a user might want a Zap to create a Trello with a Zapier
tag and a tag with a value from the previous step.
Line items (powered by the children field) are great for when users are mapping line items from previous steps. These allow for Zaps to create a dynamic amount of objects - 0 or more of these might be created. When a user has a Zap that returns data from Step A in the form of:
{
"id": 42,
"name": "Caleb McQuillin",
"phone_numbers": [{
"name": "work",
"number": "314-159-2653"
}],
"email_addresses": [{
"name": "work",
"address": "caleb.mcquillin@example.com"
}, {
"name": "personal",
"address": "caleb.mcquillin@example.net"
}]
}
If you set up your action with the following inputFields
:
[{
key: 'email_addresses',
required: false,
children: [{
key: 'type',
required: true,
type: 'string'
}, {
key: 'email',
required: true,
type: 'string'
}]
}]
Then a user can map the email_addresses.name
from Step A to email_addresses.type
for Step B and email_addresses.address
from Step A to email_addresses.address
for Step B. As the Zap is enabled, new entries might have 0 email addresses, 1 email address, 100 email addresses, etc. Your inputData
would contain the following based on my previous example:
{
"email_addresses": [{
"type": "work",
"email": "caleb.mcquillin@example.com"
}, {
"type": "personal",
"email": "caleb.mcquillin@example.net"
}]
}
If you set up your action with the following inputFields
:
[{
key: 'email_address_types',
list: true,
required: true
}, {
key: 'email_address_addresses',
list: true,
required: true
}]
Users will be able to specify a static amount of email addresses to map from Step A to Step B. If Step A returned data in the format of
{
"id": 42,
"name": "Caleb McQuillin",
"home_phone": null,
"work_phone": "314-159-2653",
"home_email": "caleb.mcquillin@example.net,
"work_email": "caleb.mcquillin@example.com",
}
and a user mapped the home and work email types, your inputData
would contain the following:
{
"email_address_types": ["work", "personal"],
"email_address_addresses": ["caleb.mcquillin@example.com", "caleb.mcquillin@example.net"]
}
and you would likely use scripting to zip them together in an array of objects.
I hope all of that makes sense! Let me know if you have any questions based on the above. :)