Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Moving to Tinderbox 6 >> working with attributes assigned to a note
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1415413657

Message started by jasonromney on Nov 7th, 2014, 9:27pm

Title: working with attributes assigned to a note
Post by jasonromney on Nov 7th, 2014, 9:27pm

Hi Folks, I'd be grateful if someone could advise these answers please:
1. what is the max number of attributes that can be assigned to a note in TB6?
2. is there a way to increase the number of displayed attributes for a note in TB6 to avoid the need for scrolling?
3. what is the action syntax to change an attribute for all children in a particular container to a desired value?
4. where an attribute comprises people's initials separated by a semicolon, should space be left before each set of initials (eg JR; PW; FO) or should the initials be squeezed together (eg JR;PW;FO)
5. can the name of an attribute that is used as a column heading in an outline view be changed? eg if I want to display $Text in the column, but have it labelled in the display as "Next steps".


Thanks to anyone who might be kind enough to leave answers to these please.

Title: Re: working with attributes assigned to a note
Post by Mark Anderson on Nov 8th, 2014, 5:52am

1. There is no finite maximum as far as I'm aware. In a recent project I had >90 user attributes. however, note all notes needed each attribute. So realistically, there isn't a limit.

If you meant, how many Key Attributes (KA) can a note have the answer is essentially the same but note that if more than 15 attributes are selected to be shown in the key attributes table in the text pane, the KA table will show a scroll bar. This is a pragmatic design choice otherwise people with many KA would have no room left to see $Text.

2. No, as stated, once more than 15 KA are configured for a note, the KA table shows a scrollbar. One form of workaround: on a big screen, using Outline view + Columns you could show a few more attributes not in the KA table. In a 27" screen I've had 10 boolean (tick-box) or number fields showing as columns.

3. You don't do such a think from a container (note). Use an agent. To set attribute $ProjectName to 'X' for a children of note "Project X":

Agent Query:  inside("Project X")
Agent Action:   $ProjectName="Project X";

Let the action run, check the changes (if desired, then delete the agent). If you wanted all descendants, as opposed to immediate children to be affected, the query would be descendedFrom("Project X")

If however, the assigned value may change over time, you might make the agent action something like: $ProjectName=$Name(original(parent));. This tells the agent to find the title ($Name) of the parent container of the original of the alias in the agent. This is because the parent of the alias is the agent.

A rule is less efficient unless the value is changing over time, but what you could do is use a rule in the children, rather than in the parent. Thus the children might have a rule:

  $ProjectName=$Name(parent);

If a child of "Project X" were moved into container "Project Y", the rule would ensure $ProjectName is updated to reflect the new parent.

Sorry for so many alternate solutions, but which is most appropriate depends on context that isn't in the original question. If confused, please just ask giving more context as to the task, how often the value will change (if at all), how many notes are involved. If you've many notes doing the same task via rules, don't overlook using prototypes (again I can explain the latter if/when needed).

4. 'should' in what sense? Is this about display style or does it relate to action code. Generally, I'd not use semi-colons in particular in this context as they are how TB stores list item. If TB's asked to guess what to do with "JR;PW;FO" it may guess that rather than one string "JR;PW;FO" it is actually a list of 3 discrete strings "JR" "PW" "FO". TB does provide tools for replacing characters and for joining lists or splitting strings. Again, more context is needed to give a more precise answer.

5. No. The column heading is the name of the attribute shown. Deliberately thus, so the viewer can see which attribute's data is displayed. Aside, I'm pretty sure column view was never intended for showing long bits of text as in $Text. Column view arose to enable things like checking boolean, number and short string values for completion or consistency.

~~~~~~~
As a whole, there's a missing context to these questions. By that I mean that if we knew the overall task there might be a solution that doesn't have you butting up against the limitations that are the short answer to some of your questions above.

Title: Re: working with attributes assigned to a note
Post by jasonromney on Nov 8th, 2014, 7:20am

Mark, this is enormously useful information. Thank you very much.

I had hoped to be able to adjust the display window for KAs to avoid the scroll, but c'est la vie.

Your agent guidance is perfect: just what I was looking for ie
Agent Query: inside("Project X")
Agent Action: $ProjectName="Project X";

Regarding the semicolon separating people's initials in an attribute (such as might show the initials of whoever owns a note that is a $Task), I was wondering if the use of a space impairs the ability to write agents that might later try to hunt for task notes owned by a particular person (as denoted by their initials in the semicolon delimited list).

I'm still thinking back to my now ancient love affair with Lotus Agenda ...and wanting to assign notes to a "category" (eg a person) that I can pivot around in a view...say if that person suddenly walks into my office and I want to instantly see everything I had wanted to discuss with them (without having to tap out a search agent for a minute or so before being ready to talk to my visitor)!

Cheers.

Title: Re: working with attributes assigned to a note
Post by Mark Anderson on Nov 8th, 2014, 12:06pm

spaces $ semi-colons.  OK, so you're already storing multiple people's initials in one string. Currently (I write as at v6.1.0) you can exact match a list or set value:

  $MyList=="PW"

but you can't regex match values whole or part:

  $MySet.contains("RF")

But - and I just found this - you can match multiple values. Lest assume these values for $MySet and for $MyList:
Note A - "OP"
Note B - "OP;RF"
Note C - "OP;RF;PW"
Note D - "RF;OP"

Query $MySet=="OP;RF" matches notes B and D. But, query $MyList=="OP;RF" matches only note B. I assume this is because sets de-dupe and probably re-sorts the values before doing the match. Anyway, that might give some avenue for a solution.

"...say if that person suddenly walks into my office"

I have a solution assuming you only want to cross check against one person/project. For my example we'll store these identities in a set attribute which for now we'll call $MySet. Now make and agent:
  • $Name. "Info about: "
  • $DisplayExpression. $Name + $MySet
  • Key attributes. $MySet, and any others you want
  • Query. $MySet==$MySet(agent)
To use, simply set the agent's $MySet to one of the existing range of values of $MySet. Type or use the value pop-up list. The agent then finds all notes matching the value set in the agent.

In this way, you can re-use the agent to quickly find any notes referencing a given single value of $MYSet.

Title: Re: working with attributes assigned to a note
Post by J Fallows on Nov 8th, 2014, 12:27pm


Quote:
I'm still thinking back to my now ancient love affair with Lotus Agenda ...and wanting to assign notes to a "category" (eg a person) that I can pivot around in a view...say if that person suddenly walks into my office and I want to instantly see everything I had wanted to discuss with them


This is where the new TB6 view "Attribute Browser" is your friend. And mine too, since I also recall this function from the Agenda days, through Zoot, to now.

Scenario:
- You have a variety of notes, of different types (tasks, reference notes, appointments, whatever), all of which involve certain people;
- You create an attribute $Person, and you make it a "set" rather than a string attribute. This removes duplicates and has other advantages.
- You make $Person a KeyAttribute for the notes you'll be working with (easiest via their prototypes).
- As you enter or edit items, you assign $Person values as needed. Let's say you did it by initials: GWB, BHO, WJC, GHWB, RWR, JEC etc for recent presidents. You can assign zero, one, or several of these values to each. (For instance a "War with Iraq" note would have many...)

- Then you set up Attribute Browser to show you all relevant notes grouped by $Person. There are lots of little tunings to do in AttBr, but the main point is that you can flip over there and see, neatly organized by group, everything involving GWB, everything involving BHO, etc.

That's just the summary view, but main point: Attribute Browser is the way I accomplish what you're talking about.

Title: Re: working with attributes assigned to a note
Post by jasonromney on Nov 8th, 2014, 5:13pm

Gents, thanks very much for this advice; very useful techniques.

Mark, I'm not sure how to execute your instructions in an agent.

Can you confirm my interpretations here or put me on the right path please:

$Name. "Info about: "
JR: so this just means give the agent a name such as "Find tasks owned by an individual"

$DisplayExpression. $Name + $MySet
JR: where does the $DisplayExpression get set? Does this mean I need to insert a $DisplayExpression attribute into each note I want to potentially be retrieved by this agent? Or is this a setting you want me to insert into the agent's settings (if so, where please?). Is the syntax I would use for this: $Name + $TaskOwner
...given that in my Tinderbox file, the equivalent of your $MySet example is my user attribute $TaskOwner

Key attributes. $MySet, and any others you want
JR: so this just means insert initials into the $TaskOwner attribute field, right?

Query. $MySet==$MySet(agent)
JR: so in my case, this is pasted into the query field of the agent, but literally in the form of: "$TaskOwner==$TaskOwner(agent)", right?
Not sure what the (agent) part of this expression does.

Thanks again for your help.

Regards, Jason

Title: Re: working with attributes assigned to a note
Post by Mark Anderson on Nov 8th, 2014, 6:30pm

Agent's name: just call it "Info about: " without the quotes. (note the space at the end).

With the agent selected, in the Text Inspector, put this code in the box marked 'Display Expression': $Name + $MySet

(Here's info on the Inspector.)

The idea is that when you give the agent's $MySet a value 'Project X', the display expression you've just set for the agent means that agent's title becomes 'Info about: Project X'. If you then change $MySet in the agent to 'Bob Smith', the title becomes 'Info about: Bob Smith'. the idea is that the display expression tells you the $MySet value is it currently querying.

If you don't like that title, by all means use something different. Also by all mean use a different attribute than $MySet, such as $TaskOwner, I'm just showing you how. :)


Quote:
but literally in the form of: "$TaskOwner==$TaskOwner(agent)", right?

Yes, but without the quotes:

$TaskOwner==$TaskOwner(agent)

The query matches any note whose $TaskOwner value(s) include a value that exactly matches the value you've set in $TaskOwner in the agent. That's why you make $TaskOwner (or $MySet or whatever attribute) a key attribute so you can both easily edit that value and see the value you've set.


Quote:
Key attributes. $MySet, and any others you want
JR: so this just means insert initials into the $TaskOwner attribute field, right?
Yes, but first set $TaskOwner as a key attribute so you can see/edit it in the agent.

To set a key attribute, select your note or agent, then click the '+' button above the top right corner of the $Text area. From the pop-over dialog, find and select the attribute you want, e.g. $TaskOwner, and tick it (you can select more that one). When done, click off the pop-over to close it.

Title: Re: working with attributes assigned to a note
Post by jasonromney on Nov 8th, 2014, 6:47pm

Mark, thanks for your clarifications. Very helpful and lucid.

I'm finding the agent is still not doing what I want, however. It DOES find all notes where the $TaskOwner attribute has the initials of an individual such as LP, but will NOT find the many more notes that have multiple task owners, of whom, one is the person with the initials LP. In such notes that relate to a task with multiple owners, I have the $TaskOwner attribute as a set (not a list), to take advantage of what I understood from your earlier post means that the initials LP will be found, regardless of where they appear in the set eg FO;LP;AJ will be found, along with AJ;FO;LP etc. But it seems like the query I am current using will only find notes where the SOLE $TaskOwner value is LP. How should I adjust this please?

Title: Re: working with attributes assigned to a note
Post by Mark Anderson on Nov 9th, 2014, 8:02am

First, if you haven't, I ensure you've read the aTbRef notes on equality tests (==) and .contains() in the context of lists - Set or List types are broadly the same.

So, the status quo is that a list can be queried for a match to a single list value. You want to match multiple values in one go, so you're trying to do something not currently supported (but read to the end before replying. It looks like my test last night was some sort of edge case. Here's what I see right now:



If you want to check 2 values you need to do something like:

$MySet.contains("PW") & $MySet.contains("OP")

To automate that for is possible, but I don't think will full work. So you might have a query like:

$MySet.contains($MyStringA(agent)) & $MySet.contains($MyStringA(agent))

And you'd set the agent $MyStringA to "OP" and $MyStringB to "PW". (It doesn't matter the exact name of the attribute storing the match strings - it's just a place to store a text value the query can read). But, I don't think this scales. Leave one test box empty and you get no matches, even thuogh you've specified one term. This is not a mistake, such a query is working correctly. The point I'm showing in detail is that your scenarios needs an on the fly variable query that TB's currently not well placed to create, or certainly not without a fair amount of expertise and fiddling - which I don't think is your starting point. I thought it useful to work this through to safe you pushing down what may be a blind alley.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.