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:
- <format> in the Options section of the field management. Details in -- link to nonexistent node ID 404 --
- You can create a new field, say YourDate, which would be based on the YourDateTime one:
- Name: YourDate
- Type: Date
- Options: <source>SELECT ItemID, int(YourDateTime) as YourDate
FROM ¯qYourDateTime;
</source> - 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:
- Choose / create a date field to overwrite the ItemCreated value (this example uses the field MyItemCreated)
- Create a new date field:
- Name: SortingDate
- Type: Date
- Options: <source>SELECT ¯qItemCreated.ItemID, IIf(IsNull([MyItemCreated]),[ItemCreated],[MyItemCreated]) AS [SortingDate] FROM ¯qItemCreated LEFT JOIN ¯qMyItemCreated ON ¯qItemCreated.ItemID = ¯qMyItemCreated.ItemID;</source>
- This way, the SortingDate will display the item created date unless the user enter something in MyItemCreated
Notes:
- 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)
- You can create grids to show items in these smart fields, use them in filters and in sorting, just like any other field.
- 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:
- Hide in Info. Pane
- Hide in Available fields
- 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
- These smart fields, take no database space at all and is automatically updated
- Pierre_Admin's Blog
- Log in or register to post comments
Comments
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.
FROM ¯qDate;</source>