Group by grids

Submitted by iqhlp on 2025/04/27 19:33

i'm trying to pull items from the base into a new grid and group matching items by what grids they belong to.  i know theres a shownin field in the properties which lists all the grids to which an item belongs - but i cant seem to enter it in the grid as a field. how can i get it as a field in a grid and th en group by it?

example

source:

task 1 is in grids: a
task 2 is in grids: b
task 3 is in grids: a and b

 

results wanted:

grid a

- task 1
- task 3

grid b
- task 2
- task 3

Comments

Hi iqhlp,

Items don't really belong to grids, they are shown there. The only exception is the Home grid. So you have a number of ways to group items...

it could be by their field values (or tags) based on the source of the various grids (grid a, grid b)

You could also use the ItemHomeID field which links to the item home. See Item Home

HTH!

The itemhomeID does indeed get the information i need, but when I try to group by it, it doesn't show the same value as whats in the ItemHomeID - but some type 0-10 heading...?Why can't i use "shownin" because its soemthing that already exists? or maybe i can get some auto calculation to clone the itemhomeid to another feild so i can grup by it?

ItemHomeID is actually a number, as explained in the doc page I referenced, so the (limited) built-in grouping doesn't do what you want

You could create a smart field to get the grid name and use that to group. Would you like me to show you how to do this?

p.s. ShownIn information is computed based on the various grid items, so it isn't available to grids

Pierre_Admin
IQ Designer

Hi Pierre,

Following up on the above discussion – would it be possible to add an option for items that are drag-and-dropped from their home grid into a new grid to automatically update their ItemHomeID to reflect the new location?

Alternatively, could there be a way so that when clicking a link to an item that is no longer in its original home grid, it opens in the grid where it currently resides, rather than defaulting to its old home or Scratch?

Here’s my current workflow:
I keep an "Inbox" grid open where I create new items. Then I drag-and-drop them into their destination grids. However, when I click on links to those items, they do not display in the grids they were moved to (which is where I consider their true “home”), but instead they open either in the original home grid (with Hoist on, even though the item has been removed), or in the Scratch grid. This forces me to manually update the ItemHomeID from time to time, which is time consuming.

Possible solutions could include:

  1. An option for ItemHomeID to update automatically when an item is moved to a new grid via drag-and-drop.
  2. When opening item links, prioritize showing them in the grid they currently reside in, before falling back to the home grid.
  3. Do not assign an ItemHomeID for items created in grids marked as “Inbox.”

    Would any of these be feasible to implement?

Thanks again for your great work on IQ!

How do I ?