Tinderbox Forum

Structured attributes

Is it possible to make it structured in attributes?

attr01> *Value*
      attr01.subAttr01 *Value*
      attr01.subAttr02 *Value*
      attr01.subAttr03 *Value*
attr02> *Value*
      attr02.subAttr01 *Value*
      attr02.subAttr02 *Value*
                                       etc.

No but you could use a Dictionary:

MyDictionary1
      key1:Value
      key2:Value
      key3:Value
      key4:Value
MyDictionary2
       key1:Value
      key2:Value
      key3:Value
      key4:Value

… noting that the dictionary keys are named as you want by you.

What is the use case here. What are you doing that needs nested attributes?

Althuogh Tinderbox has attribute groups all user attributes are listed in a single group named ‘User’. If you want sets of attributes to list together use a common start to the attribute name. Suppose you had a bunch of attributes related to grading students, you could start them all ‘Grading…’. That’s just an example.

More on naming suggestions.

For example:
For note of the same person, there are different events with their own dates

1 Like

Busy right now, but thanks, I get you point. Will respond more later.

1 Like

and we also really need this opportunity:
Lists of lists, with the ability to choose from an available full list:
((ListA01,ListB01);(ListA02,ListB02))
For example:
((born,date,place1);(defended dissertation,date,place2);(married,date,place3)) with an option to select from the list:
(born, defended, married) and (place1, place2, place3)
and all this directly in the attribute browser

Short answer (late here), look at Dictionary data type.

No, the Dictionary is not suitable for this type of data:
(Event, Event Date, Event Location) and moreover you can’t manage the Dictionary (select data from the lists you want) directly from the Attribute Browser (located above the note’s text) at all, except by directly entering complete data into the data entry line

Understood, and also helpful is your mention of the context of viewing the values in the note’s optional Displayed Attributes table. That user-selected table content is essentially a subset of what can also be seen in the Get Info pop-over/dialog’s attributes tab. However, the Displayed Attributes is a single table. You cannot group attributes. You only choice is to show (or not) an attribute and decide the order of the listing. also note that the Displayed Attributes table can only show attribute values for a(single) selected note. To view attributes in Displayed Attributes for a different note requires the desired note to be selected.

So is the issue that you are trying to avoid the labour of setting the order of Displayed Attributes for each note? If so, be aware that the Displayed Attributes table listing is itself an attribute $DisplayedAttributes. So it can be inherited (e.g. via a prototype) or set via and action (e.g. an $OnAdd or stamp), e.g.:

$DisplayedAttributes"StartDate;EndDate;DueDate";

Note that you supply just the name of the attribute(s)—not a $-prefixed reference—in the order to be listed on screen.

If you need more Date-type attributes per person (i.e. I assume note about a person) add moreDate-type user attributes.