Populating an attribute's choices via action code

In yesterday’s Tinderbox Meetup (2024-11-16), we saw a really useful code snippet demonstrated: how to build a fill-in list of choices using action code that calls on the attribute.

Naturally I had to try it immediately. But in my Tinderbox document, the attribute I select fills-in with odd values that aren’t dynamic.

I’ve attached a screen shot of my admittedly-large file. Any thoughts?

Try “+=” rather than a “=”

Tom

Thanks Tom … but that doesn’t change the outcome.

You are misunderstanding how the pop-up menu works.

The default behaviour is to show every discrete per-note value for the whole document. The suggested values list adds to that any suggested values not already in use.

I suspect you are thinking the menu shows only suggested values. That would be a wrong assumption.

The method you tried actually worked, just not in the way you imagined: suggested-populate1.tbx (185.7 KB)—see the container’s Edict and $ProjectName in the Displayed Attributes of any note showing that attribute.

If you want the op-up value list to show only suggested values, for now that is a feature request for someone to make.

Note too that in the pop-up you can’t tell which are unused suggested values as opposed to suggested values already in use. Plus you can’t tell suggested values (used or not) from non-suggested values set in that attribute.

Does that help make sense of your experiment?

Thanks! That clears up my confusion. Glad to get that additional understanding.

1 Like