🆘 AP.confluence.saveMacro generates error if macroParameters has nested array

When I do this in the custom macro editor

            AP.confluence.saveMacro({
                databaseID: '123',
                recordDataFields: [1,2,3]
            });

I get an error in the console (https://take.ms/6cBKs):

But if do the same without array, everything works fine

            AP.confluence.saveMacro({
                databaseID: '123'
            });

My dynamic macro has “bodyType”: "none"

Any ideas on how to fix that?

@dmorrow I think you may help with this :pray:

The saveMacro docs definitely lead me to believe that you could be able to pass in any valid object…

I wonder if the problem is that it doesn’t know how to handle an object with keys whose values are not strings/numbers. Maybe try something like this, as well:

AP.confluence.saveMacro({
  databaseID: '123',
  recordDataFields: 1
});

And could also try stringifying the value:

AP.confluence.saveMacro({
  databaseID: '123',
  recordDataFields: JSON.stringify([1,2,3])
});

I guess you could also try it with an empty array.

2 Likes