Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multi-level tree structure in one table

Featured Replies

I want to build a multi-level tree structure with a single table, where every child has just one parent.

The table is fairly simple and I call it 'nodes', it has the following fields:

IDnode

IDparent

nodeName

path (a calculation that should show the whole path from the tree root node)

Root nodes will point to an IDparent valued 0.

I create a second instance of this table called 'parents' and a relationship between both tables:

nodes::IDparent = parents::IDnode

Then I write the following calculation in the path field:

If (IDparent=0; node; parents::path & ">" & nodeName)

I have been able to do this with previous versions of FMP but now, under FMPA 11 I cannot.

Is something wrong with this approach? is it possible that it worked before 11? how can I get it right (without lookup fields and scripting)

The answers I found so far are very complex and I am sure I was able to make it work before...

Thank you in advance.

Perhaps this can get you started.

http://jonathanstark.com/archive/recursive-data-structures.php

  • Author

Thank you very much for the in-depth article you point to, it's very interesting, however the problem I find is with displaying a 'path', as if I would like to display all the names between employee x and the CEO.

The question is how can I build a calculation able to display the whole path of names between any employee and the CEO?

Any additional help will be welcome...

The path would consist of the individual's path to the next higher level (if there is one), plus that one's path (ditto); sort of poor man's recursion.

post-80889-0-36012600-1342353415_thumb.p

  • Author

thank you eos, this is what I meant, now it works

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.