Tinderbox Forum

Agent to sort notes into subgroups

I have an outline with a note called “Contacts”. In this note are some hundred or so notes of individual people. Some of these people live at the same address and I have an attribute called, “AddressStreet” that gives me the first line of their address.

I would like to create an agent that would sort these contacts into households by using the AddressStreet attribute. However, I would prefer to have them sorted so that each contact is aliased into a note with the AddressStreet attribute. Kind of like this:

- 10 Downing Street
  - Boris
  - Carrie
- 29 Acacia Road
  - Eric
  - Bananaman

This would give me everyone who lives at the same address. I know how to create agents and use the query. Not sure how to get the resullt I need though

Any help would be much appreciated.

Here is a way to do this.

  1. Create your agent, have the agent search for an address where the value for the input is in the agents $Address attribute.
  2. Have the address attribute automatically populate by running a collect() on the TBXConfig note (see the $Rule on TBXConfig)
  3. Enter the details in your contacts
  4. Run you searches by selecting an address in the agent. Hit ^⌘= to have the update agent function run.

Please let me know if you have any questions. Note: to my knowledge, the agent won’t return a subgrouping.

TBX L - Search contact by address.tbx (126.8 KB)

Thank you for your quick response.

That was what I was hoping. Your example was great, but I won’t know the addresses to type in the search. I was hoping for somethings to group them in some way. I can do this in the attribute browser, but need the grouping long term. Many thanks!

That is why I added the TBXConfig. You don’t need to know the address. TBX will index every address and then you can select the address you want from the dropdown list in the agent. Try it. Add a new contact with a different address and you’ll see the new address appear in the list. Select the new address in $Address on the agent and then run the agent.

1 Like

That might be workable! I shall look through the tbx you kindly made more carefully and play with it on my contacts list. Many thanks!

1 Like

You bet. :slight_smile: Let me know if you have any other questions.

I’ve implemented that into my tbx and it works nicely. Thank you!

1 Like