cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Display Hierarchy with Concat's or something

I have 4 entities in CDM/Dynamics that each have a many to 1 relationship with the entity beneath it. So

A is at the Top with many B's below it and many C's below B and Many D's below C. In the GUI this looks like D has a lookup field to C and C has a lookup field to B and B has a lookup field to A.

 

My questions is how can I take that hierarchy and display it in a Hierarchical fashion. I have attempted this with nested Conccats but can't seem to get it correct and get invalid type error to often once I get into the second concat. Any ideas?

 

Example  Layout:

A1

  B1
    C1

       D1
    C2
       D2

       D3

  B2
    C3
        D4

        D5

    C4

        D6

    C5

        D7

 

 

 

 

4 REPLIES 4
Responsive Resident
Responsive Resident

Hi,

 

There are couple of ways to do that. One of the way is Add nested Galleries.

 

Let me elaborate on how to do that.

 

  1. Create a Main Gallery for A and bind all A datasource to it.
  2. Create Gallery B and in Items property bind all B with filter condition i.e. Filter(BDatasource,AFieldName=thisitem.selected.AFieldName).
  3. Repeat the same for any number of nested galleries.

 

if this answers your question mark it as verified and give it a thumbsup

Regards,

Pavan Kumar Garlapati

Community Support
Community Support

Hi @JohnBrown ,

Do you want to display 4 Hierarchy layout within your PowerApps app?

 

If you want to display 4 Hierarchy layout within your PowerApps app, I afraid that there is no way to achieve your needs in PowerApps.

 

Currently, within PowerApps, you could only create a 2 Hierarchy Gallery layout, in other words, you could add a nested gallery within a Main gallery, but you could not add another nested gallery within the above nested gallery (3 Hierarchy Gallery is not supported).

 

As an alternative solution, you could consider create 4 individual Gallery controls to achieve your needs. Each gallery control is corresponding to each Entity as below:1.JPG

Set the Items property of the Gallery1 to follownig:

'EntityA'

Set the Items property of the Gallery2 to following:

Filter('EntityB', LookUpField_BToA.'Primary Name' = Gallery1.Selected.'Primary Name')

Set the Items property of the Gallery3 to following:

Filter('EntityC', LookUpField_CToB.'Primary Name' = Gallery2.Selected.'Primary Name')

Set the Items property of the Gallery4 to following:

Filter('EntityD', LookUpField_DToC.'Primary Name' = Gallery3.Selected.'Primary Name')

Please consider take a try with above solution, then check if the issue is solved. On your side, you could select different items in your Gallery1, then the corresponding child Hierarchy would be shown up within Gallery2, Gallery3 and Gallery4.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft,

 

Is the same true when working with Concat() function? I have not been able to get it to work past a second layer.

 

John

Hi @JohnBrown ,

If you want to use Concat function to achieve your needs, I afraid that there is no easy way to achieve your needs. You may need to type multiple nested Concat function within your formula.

 

As an direct solution, I think the 4 Gallery controls may be the better choice for you.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (18,328)