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
Replacing an attribute in a set of notes (Read 6676 times)
greg ibendahl
Full Member
*
Offline



Posts: 15

Replacing an attribute in a set of notes
Aug 07th, 2007, 4:46pm
 
I'm not sure this is the appropriate place for this but it seems like an appropriate action might do the trick.

I imported a spreadsheet that had about 40 student records in it into tinderbox. Everything at first glance went as expected. I ended up with 40 new notes and each note had a new user attribute based on the columns of my spreadsheet. I then went ahead and added other info to the notes. I later noticed that  one of my attributes (date_joined) was incorrect as the date field imported as a number. I should have converted the date in Excel into a text value before importing. This was easy enough to change in Excel. My problem though is that I don't want to reimport all the student records again as I've already added additional info to the notes in Tinderbox.

Here's what I'm wondering might work. Set up a temporary agent to collect all the student records. Create an action that would replace the date_joined field in each note with the correct value. These correct values would either be in a list in another note or I could just import the correct date into another set of notes. For something like this to work though it seems like I would need some way to match student notes to date notes in some type of sequential order. Is this even possible?
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Replacing an attribute in a set of notes
Reply #1 - Aug 7th, 2007, 5:37pm
 
Sure, it's POSSIBLE.  But I wonder whether this is worth the effort. It seems to me, you have a couple of good options.

If you haven't made many changes to the student records in Tinderbox yet, you could simply revise the spreadsheet and import again.  That seems easy enough.

Another approach: sort the spreadsheet AND the imported notes by some handy criteria --perhaps student name.  Now they;re in the same sequence.  Make the date a key attribute.  Now, print out the list of names and dates from the spreadsheet, and manually enter them in Tinderbox.  With 40 students, and (I fancy) about 3 students/minute, it will be done before you know it.

If you had 4000 student records needing updating, I'd suggest investing in a fancier solution.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Replacing an attribute in a set of notes
Reply #2 - Aug 8th, 2007, 12:35pm
 
Mark's idea #2 could be extended - though read through to the end of this post before you start trying it out.  

Drag all the existing imported notes into a new container 'Bad Import'. Then and re-import the corrected Excel file into a container 'Good Import' - the first step is partly to avoid the second import overwriting or clashing with the first. However you do it, you want 2 sets of each note, each inside a separate container note. It is also assumed 'Bad Import' and 'Good Import are unique names within the TBX. If the latter is not true alter them to make the names unique and amend the following instructions accordingly.

Now make an agent that finds all notes inside container 'Bad Import' and an action that copies date_joined data from the 'Good Import' container:
Query: #inside(Bad Import)
Action: DateJoined = $DateJoined("/Good Import/" + $Name)

...except the latter isn't working. I suspect the x in attribute(x) can't be anything except a literal string - i.e. not an expression.

Oops, I think I've over-reached here. ...Mark B, is that true?  

Still I'll put the idea up here  in case it is do-able with a correction to my code. Assuming it is fixable, once the data transfer is complete, you simply delete the agent, the 'Good Import' container and all its contents. Rename 'Bad Import' to something else.
Back to top
 
« Last Edit: Aug 8th, 2007, 3:51pm by Mark Bernstein »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Replacing an attribute in a set of notes
Reply #3 - Aug 8th, 2007, 3:58pm
 
No, you can't (in Tinderbox 4) replace a note name or keyword with an expression:

    $Name(parent)    <- OK
    $Name(/Home Runs/Bonds)  <-- OK
    $Xpos(42) <-- looks for a note named "42"
    $Name($Path) <-- NO!
    $Name(7*6)  <-- NO!

I am inclined to allow the third example -- that is, a simple attribute reference -- or perhaps both the third and the fourth examples.  Comments and suggestions are welcome.
Back to top
 
 
WWW   IP Logged
Paul Walters
Ex Member




Re: Replacing an attribute in a set of notes
Reply #4 - Apr 23rd, 2008, 8:52pm
 
Could you export the "bad" notes, import them into Excel, fix the date problem, then import the whole group back into Tinderbox into a new container?  If they check out, then delete the old notes.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print