Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Is there a simpler method for this... (Read 6327 times)
Paul Walters
Full Member
*
Offline



Posts: 267

Is there a simpler method for this...
Nov 28th, 2010, 2:45pm
 
I am exporting notes collected in an agent.  Each note has a child note that is a sort of footnote or annotation.  Call it "myAnnotation".    Each such note has the same name.  The children are not collected by the agent (and I don't want them there).  Their parents are collected by the agent; which is what I want.  I am grabbing the values of a few attributes from those children in a tab-delimited file I am exporting.

Within the export template I use this code:

Code:
^getFor(^value($Path(original)^ +"/myAnnotation")^,$Text)^ 



Is there a simpler way to get the value of an attibute of a particular child of a note?  Especially where all such children have the same $Name.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Is there a simpler method for this...
Reply #1 - Nov 28th, 2010, 4:12pm
 
If I understand you correctly, the target notes have one child. If so, something like the following might suffice:

   ^value($Text(child(orginal)))
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Is there a simpler method for this...
Reply #2 - Nov 28th, 2010, 5:24pm
 
If the target note has more than one child, you might need to get the path to the original and concatenate the child name to give an unambiguous absolute path.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Is there a simpler method for this...
Reply #3 - Nov 28th, 2010, 5:32pm
 

Quote:
@Mark Anderson wrote: If the target note has more than one child, you might need to get the path to the original and concatenate the child name to give an unambiguous absolute path.

Yes, that's my case.  And that's what my code does in the OP.  I was testing if a variant of Mark Bernstein's suggestion would work, but it doesn't seem to.

Quote:
This does not work:

^value($Text(original/myAnnotation))^
Back to top
 
« Last Edit: Nov 28th, 2010, 5:33pm by Paul Walters »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Is there a simpler method for this...
Reply #4 - Nov 28th, 2010, 6:04pm
 
Not sure why you're using both ^getFor and ^value. I've only done a trivial test, but this seems to work:

  ^value($Text($Path(original)^ +"/myAnnotation"))^
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Is there a simpler method for this...
Reply #5 - Nov 28th, 2010, 7:57pm
 
That's definitely simpler. Thank you.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Is there a simpler method for this...
Reply #6 - Nov 29th, 2010, 11:24am
 
How about

    ^value($Text(my Annotation(original)))
or
   ^value($Text(./my Annotation(original)))

To be fair  I myself wasn't sure this would work. But I tested it, and it does.
Back to top
 
 
WWW   IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Is there a simpler method for this...
Reply #7 - Nov 29th, 2010, 11:57am
 
@Mark Bernstein

This is very cool.

If we have this hierarchy:


A
--B
----C
------D


Then this works:

^value($Text(./D(./C(./B(original)))))^

I'm able to reach down into selective portions of the hierarchy and pull out attributes to put into flat tables that summarize important factors in the notes.  For the complex report I'm preparing this is amazingly flexible.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print