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

AddColumns from Parent table lookup

 

3 tables - Parents, Children and Colors. Colors is a referential lookup to the Parent table, and Parents is a parental lookup to the Children table.
 
I need to see the Parent's favorite color in the gallery, which is based on the Children table.
 
Is an AddColumn with a Lookup the way to go? Is there a way to hop entities with "."s? I can't figure it out.

 

 

Untitled.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: AddColumns from Parent table lookup

Hi @CurtJanus ,

Do you mean that Parent entity has a lookup field related to Color entity and Children entity has a lookup field related to Parent entity?

Do you want to filter parent's favorite color based on the children's name?

If so, you could get this value by using this formula: (set the label's Text inside the gallery)

LookUp(Parent Table, 
       ParentName =ThisItem.PName.ParentName,   //filter the record based on the child's parent
       color lookupfield in parent entity       //get this record's color lookup field value
      ).colornamefield in color entity        //get color value based on color lookup field value

If you want to shape your children table add color field, you could try:

ClearCollect(Children, 
             AddColumns(Children Table , 
                        "ParentFavColor", 
                        LookUp(Parent Table, 
                               ParentName = PName.ParentName, 
                               color lookupfield in parent entity 
                               ).colornamefield in color entity  
                           ) 
               )

//ParentFavColor will be the field that display the parent's favorite color

 

Please do not forget to connect with parent,children,color these three entities.

 

 

 

Best regards,

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

View solution in original post

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: AddColumns from Parent table lookup

@CurtJanus 

Yep, I think you are on the right track. Maybe try this on a 'Add Fav Color' button (AddColumns is a behavior formula from memory):

 

AddColumns('Children Table' , "ParentFavColor", LookUp('Parent Table', ParentName = PName, 'Favourite Color'))

Note: the gallery items would need to come from a collection that this formula adds a column to. You couldn't add this column to your data source - unless it already exists?

 

To build an items gallery you could do:

ClearCollect(galleryItems, AddColumns('Children Table' , "ParentFavColor", LookUp('Parent Table', ParentName = PName, 'Favourite Color')) )

 

I haven't tested the above so it may need some tweaking but I think it's on the money.

Highlighted
Community Support
Community Support

Re: AddColumns from Parent table lookup

Hi @CurtJanus ,

Do you mean that Parent entity has a lookup field related to Color entity and Children entity has a lookup field related to Parent entity?

Do you want to filter parent's favorite color based on the children's name?

If so, you could get this value by using this formula: (set the label's Text inside the gallery)

LookUp(Parent Table, 
       ParentName =ThisItem.PName.ParentName,   //filter the record based on the child's parent
       color lookupfield in parent entity       //get this record's color lookup field value
      ).colornamefield in color entity        //get color value based on color lookup field value

If you want to shape your children table add color field, you could try:

ClearCollect(Children, 
             AddColumns(Children Table , 
                        "ParentFavColor", 
                        LookUp(Parent Table, 
                               ParentName = PName.ParentName, 
                               color lookupfield in parent entity 
                               ).colornamefield in color entity  
                           ) 
               )

//ParentFavColor will be the field that display the parent's favorite color

 

Please do not forget to connect with parent,children,color these three entities.

 

 

 

Best regards,

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

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,900)