Steps to reproduce:
- Create a new pack using the Hello World sample code
- Create schema as per the following:
const OutputSchema = coda.makeObjectSchema({
properties: {
output: { type: coda.ValueType.String },
prop1: { type: coda.ValueType.String },
prop2: { type: coda.ValueType.String },
// Add more properties here.
},
displayProperty: "output", // Which property above to display by default.
});
- Modify coda’s
pack.addFormula
like so:
resultType: coda.ValueType.Object, // instead of string
schema: OutputSchema, // add this property
execute: async function ([name], context) { //modify execution function
return {output: "out", prop1: "0", prop2: "str"}
}
- Run the formula in a test doc
Expected Output:
It should literally spit out the object literal you just gave it
Actual Output
The first (display) property “output” is entirely missing. Other two properties still appear.
See test doc and source code below. I’ve created four different formulas that all should be identical… but give different output because of missing newlines or trailing commas in the object literal.