Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you tell if a Group is a root node or not via REST API?

JeffLetterman
Archer Employee
Archer Employee

The REST API controller, Metadata Group, for Group Hierarchy (api/core/system/grouphierarchy), returns an Id, RelatedId, and Generation. 

 

I can't figure out how to replicate the Manage Groups nested list in the UI based on the data returned by REST API.  It seems some Groups are displayed as root nodes (Generation=0), while others are not. 

1 ACCEPTED SOLUTION

Accepted Solutions

SamSalefske1
Contributor III

Jeff,

 

Hopefully I can shed some light on this although I see it's a question from 2016 with no answers so maybe you've already got your answer.

 

Every group will be a generation=0 according to the documentation: "A group is always in generation zero (0) for itself. A group is in generation 1 for its immediate parent." So for you to know if a group is a parent group, it basically won't have any children (RelatedIds) and will have a generation of 0. The children will show up in the relatedIDs, and have a generation of 1. It looks something like this:

16 (parent)
>2 (child)
>17 (child)
>18 (child)
>19(child)

 

pastedImage_1.png

View solution in original post

1 REPLY 1

SamSalefske1
Contributor III

Jeff,

 

Hopefully I can shed some light on this although I see it's a question from 2016 with no answers so maybe you've already got your answer.

 

Every group will be a generation=0 according to the documentation: "A group is always in generation zero (0) for itself. A group is in generation 1 for its immediate parent." So for you to know if a group is a parent group, it basically won't have any children (RelatedIds) and will have a generation of 0. The children will show up in the relatedIDs, and have a generation of 1. It looks something like this:

16 (parent)
>2 (child)
>17 (child)
>18 (child)
>19(child)

 

pastedImage_1.png