Submitted by Pierre_Admin on 2009/04/07 12:43
Smart folders are used by a number of programs, such as Zoot and EverNote. They are sometimes also called Saved Searches as in Ultra Recall. Smart folders collect information items without the user specifically doing it.
 
In IQ (and in Ecco), folders are fields and fields are folders... this means that you can create a field which will behave as a smart folder.
 
Examples of smart folders:
  • ItemIsBold: collects all items that are bold
  • ItemIsRed
  • ItemHasHTML
  • TasksForJohn
  • Date (without the time part) of a field with date and times
  • Date which combines 2 date fields
Smart folders typically take their information from:
  • UI related fields (ItemFont, ItemColor, ItemsTagged, etc)
  • Other fields, fields that the user did enter information.
This means that you can extract and collect items using a huge variety of techniques:
  • Use any text, number, date field and collect items that have specific values (or value range)
  • Use tags inside the Item field (or another) such as:
    • If the item is: Talk to {joe} on project {somiro}, then a smart folder-type field can collect all items tagged as "Joe" or all items tagged "Somiro"
This gives users a simpler, quicker and "softer" coding method, than regular fields.
 
Currently, there is no UI specific to creating these smart folder-type fields, but users can easily modify existing examples:

ItemIsBold:
  • Type: Yes/No
  • Options: <source>SELECT ItemID, [ItemID]>0 AS ItemIsBold
    FROM ¯qItemFont
    WHERE ((InStr([ItemFont],"|B|")<>0));
    </source>
ProjectSomiro:
  • Type: Yes/No
  • Options: <source>SELECT ItemID, [ItemID]>0 AS ProjectSomiro
    FROM ¯qItem
    WHERE ((InStr([Item],"{Somiro}")<>0));
    </source>
Dates without times
Say you have a date field which also contains times. An example would be the field used for the Calendar (ApptDate). You may want to hide the time part. You have at least 2 ways to achieve this:
  1. <format> in the Options section of the field management. Details in -- link to nonexistent node ID 404 --
  2. You can create a new field, say YourDate, which would be based on the YourDateTime one:
    1. Name: YourDate
    2. Type: Date
    3. Options: <source>SELECT ItemID, int(YourDateTime) as YourDate
      FROM ¯qYourDateTime;
      </source>
    4. Make sure you substitute all instances of YourDateTime and YourDate with your own field names!
Date that combines 2 date fields
In this case, the user wanted to sort on the created date of an item, but at times, that date was not appropriate for the sort. It was proposed to copy the created date to another date field and sort on this new field (ItemCreated is read-only). A more elegant solution uses smart fields:
  1. Choose / create a date field to overwrite the ItemCreated value (this example uses the field MyItemCreated)
  2. Create a new date field:
    1. Name: SortingDate
    2. Type: Date
    3. Options: <source>SELECT ¯qItemCreated.ItemID, IIf(IsNull([MyItemCreated]),[ItemCreated],[MyItemCreated]) AS [SortingDate] FROM ¯qItemCreated LEFT JOIN ¯qMyItemCreated ON ¯qItemCreated.ItemID = ¯qMyItemCreated.ItemID;
      </source>
  3. This way, the SortingDate will display the item created date unless the user enter something in MyItemCreated
Notes:
  1. It is important that the field name be the same as the AS xxx part of the SQL clause ("AS ItemIsBold" and "AS ProjectSomiro" in the above 2 examples)
  2. You can create grids to show items in these smart fields, use them in filters and in sorting, just like any other field.
  3. If you want, you can hide these specialized field in sections of the properties pane (so it doesn't get too crowded, if you do so, you can still show the field in forms and in grids). In Field Properties:
    1. Hide in Info. Pane
    2. Hide in Available fields
  4. You don't need to use curly brackets if you don't want to, any delimiter will do, even no delimiter, as this system is entirely into your hands
  5. These smart fields, take no database space at all and is automatically updated

Comments

Hello.
 
I don't understand the syntax / meaning of the FROM part of the SELECT clauses.
 
What's the significance of _q in the table name?
 
Where are these tables documented? Or what do we need to know in order to be able to use them?
 
Many thanks for any light you can shed!
 
Mark Gregory, Rennes, France - GMT +1/+2; EST +6

Pierre_Admin

2009/07/07 23:12

In reply to by gregory

The "¯q" is a prefix to ensure no name conflict.

The grids and fields share the same name space (technically, they are all queries) and so I wanted to put as little restriction as possible on grid names, hence the "¯q" prefix on queries to generate field values

That is, the query name to retrieve the field values of the field YourField is "¯qYour Field"

This is not yet documented

gregory

2009/07/07 23:22

In reply to by Pierre_Admin

OK, that clears things up a bit! Thanks.
 
Mark Gregory, Rennes, France - GMT +1/+2; EST +6

Just to be sure I understand... this is syntax to create new fields that I can use in existing grids or in creating a new grid that is "smart", correct?

Also, there is the issue of tags "{joe}" and "{somiro}". I still don't think the word "tag" is conceptually clear for it's use in IQ. I thought this was "selection".

After all this time, I still don't know how to create a link between two items. If I can not relate items, then the use of IQ is moot.

That being written, I think this is the kind of post that really needs pics.

Is IQ going to actually get "tags" as in a 'tag cloud'? Check out 40:30 on the Google Wave link you provided.

I watched/listened to it because I was thinking we could all get onto one "wave" at one time for 30 minutes and update a page of the book. This would really assist Keith and also help us conclude descriptions and terms much faster.

If IQ is going to grow in the way where is keeps current and attracts new users, we have to find a way to make simple tasks easy or, at minimum, easily understood.

jan_rifkinson

2009/07/08 14:37

In reply to by ericka

[quote=ericka] [snip] I still don't know how to create a link between two items. [/snip[/quote]
 
Ericka,
 
Select an item in your outline, go into edit mode, i.e. <F2>
underscore, i.e. select the word or phrase you want to link to another item, i.e .<SHFT>+ arrow right or left
When you have completed your selection, <CTRL>+K or right click to context menu & select link icon or the equivalent "link" option
In the new dialog that appears, click "Select Items" button which will open a search dialog
add your search criteria & IQ will list appropriate items a you type
focus on the item you want to link to & click "go" which will add the item ID # in the open box
once you click "OK" the dialog will close & you will see a blue line underscoring the word or phrase you selected origianally
clicking on this link will take you to the linked to item.
 
Does this explanation help you?
 
I agree (& it has been mentioned before) IQ tagging is a little confusing.  However, having said that, it is totally different from the wiki tags which appear between curly brackets, i.e. {wiki tag}
Tagging is a way of making a list of items which you can then affect with some function. Example: make all items bold or yellow,etc. Tagging is temporary
Wiki Tags, OTOH, are permanent classifications of an item.  So for example, you might add a wiki tag and call it "computer". And every item you add to your dB that has to do w computers you include in that category, i.e. add that wikitag from the list of wiki tags. This is no different than adding a zip code from a selection of zip codes.
 
Later, if you ever wanted to pull up all your 'computer' items (which might live in various grids, you could select that wikitag & ALL your computer items would show up in a search / scratch pad.
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Armando

2009/07/08 15:19

In reply to by ericka

 
>Also, there is the issue of tags "{joe}" and "{somiro}". I still don't think the word "tag" is conceptually clear for it's use in IQ. I thought this was "selection".
 
There have been discussions about this already.  The terminology should just be changed for that feature un particular. Something like Select/Selection list, whatever.
 
I've created a Mantis issue for that ( 0750 )
 
 
> After all this time, I still don't know how to create a link between two items. If I can not relate items, then the use of IQ is moot.
 
Thanks to Jan. And there's also a manual...
Not perfect, but better than nothing.
 
 
 
> Is IQ going to actually get "tags" as in a 'tag cloud'? Check out 40:30 on the Google Wave link you provided.
 
If you like Tag clouds  you can always make a suggestion
 
There are other tag posts in mantis. Tags : mantis issue  0060 .
 
( it's already pretty easy to implement a tagging system in IQ. I've done it since the beginning... I use the wikiTag field, but don't use the { } as I don't care for WikiTags as such. Maybe beause I find the { } stuff cumbersome to manipulate on the fly.)
 

jan_rifkinson

2009/07/08 17:51

In reply to by Armando

Armando, are wikitags designated by {} for search purposes.... or what's their point.  I thought one had to use them to get wikitag. If they aren't necessary, why are they included?  
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Tom

2009/07/08 18:38

In reply to by jan_rifkinson

[quote=jan_rifkinson]
Armando, are wikitags designated by {} for search purposes.... or what's their point.  I thought one had to use them to get wikitag. If they aren't necessary, why are they included? 
[/quote]
 
AFAIK, it doesnt matter really what field he uses for his tags - remember he uses filters as long as an arm or a leg . . 
 
Wikitags (currently) need the fancy brackets

Pierre_Admin

2009/07/08 18:41

In reply to by Tom

I'll most likely drop the {} for wikitags and go for CamelCase or comma separated. 2 schools of though here... any preferences. Perhaps we should start a new thread as this is unrelated to Smart Fields.
 

Armando

2009/09/11 14:13

In reply to by Pierre_Admin

This page is not editable by normal users it seems.
 
I just wanted to add this example for smart fields :
 
 
Day field (linked to a specific date -- already included in IQ's "sample data" database)
 
The sample app has a Day field (type=Text) which is linked to the date field.
 
1- In Field management dialog, go to the Day field
2- look at the Options. You should see :
 
<source>SELECT ItemID, Format([Date],"ddd") AS Day
FROM ¯qDate;</source>
 
 
This gives the day of the week for the Date field.
 
You could simply change the Date field name for any other date field name you need and it will do it for that field!
 

Pierre_Admin

2009/09/11 14:45

In reply to by Armando

>This page is not editable by normal users it seems.
 
No, because it is a blog I wrote. A book page was created with the same content: Smart Fields.
 
I'll remove this one from the user manual.
 

Armando

2009/09/11 14:54

In reply to by Pierre_Admin

ooops. Sorry about the confusion.