I’m using an automation to pass an action an array of objects as a parameter. I’m having trouble with the syntax for makeParameter.
The question seems similar to this post from 2021, but the solution does not appear to be the same:
Here’s the code snip:
const EmployeeSchema = coda.makeObjectSchema({
properties: {
name: { type: coda.ValueType.String },
email: { type: coda.ValueType.String },
manager: { type: ManagerSchema},
// Add more fields as necessary
},
displayProperty: "name",
});
pack.addFormula({
name: "AssignStaffToContract",
description: "Assign staff to a Harvest contract",
parameters: [
coda.makeParameter({
name: "SchoolManager",
description: "List of school managers",
type: coda.ParameterType.Array,
items: EmployeeSchema,
}),
I get the following build error:
- formulas[3].parameters[0].type: Required
- formulas[3].parameters[1].type: Required
Bonus question:
Can I make the schema recursive? Instead of building ManagerSchema, can I just have manager be EmployeeSchema?
Thanks!
Josh