Populating a default set attribute

There was a very useful technique for populating the default for a set or list attribute from the child note values of an existing container … try as I might, I can’t locate that post.

I’ve got a set attribute, $MySet, that is populated from this action code: $MySet=collect(children,”Program Categories”); and that works fine.
But how to use $MySet to serve as the default for another note’s category choice?

OK, so you want the suggested values of $SomeOtherAttribute to be the contents of $MySet? If so:

attribute("SomeOtherAttribute")["suggested"]=$MySet;

Yes! Thank you …

1 Like