Skip to main content

hi all,

Is there a way to have required children if and only if the parent has been set or to make items required as a group? We’re trying to do something like the following, where (in this example) supplying pets is optional but if someone supplies part of a pet’s information they have to supply all of it.

// Doesn't work, ends up effectively making all pets required
...
inputFields: d
{
key: "first_pet",
required: false,
children: e
{ key: "first_pet_name", required: true, type: 'string' },
{ key: "first_pet_species", required: true, type: 'string' },
...
]
},
{
key: "second_pet",
required: false,
children: e
{ key: "second_pet_name", required: true, type: 'string' },
{ key: "second_pet_species", required: true, type: 'string' },
...
]
},
...
]

We can do this with a bunch of custom validation in perform but wondering if there’s a way to do so within the schema.

From poking around a bit more, most recent advice seems to be write the boilerplate validation ourselves: https://github.com/zapier/zapier-platform/issues/11 which is disappointing, but marking as answer to close.