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

How to combine complex collections like this

I was trouble about 8 hours, but I don't figure out so please let me know.

There are two collections that match only their Name column(But ColB has multiple columns with the same Name).

I want to get the Thumbnail URL of the smallest ID that matches the Name (Thumbnail column is a table and I want to get just Large URL) and make new collection(OutputCol ).

 

How can I create an OutputCol like the image below?

hyonta_0-1634715477548.png

I would very appriciate any idea.

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

To put together these collections by relating the Name from ColA with the lowest number ID in ColB, try:

Clear(OutputCol);
ForAll(ColA As aItem,
    With({aRecord: 
        First(
            SortByColumns(
                Filter(ColB, Name = aItem.Name),
                "ID",
                SortOrder.Ascending
            )
        )
    },
    Collect(OutputCol,
        {
            Name: aItem.Name,
            Title: aItem.Title,
            Link: aItem.Link,
            ID: aRecord.ID,
            ThumbnailURL: aRecord.Thumbnail.LargeURL
        }
    )
    )
);

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
BCLS776
Super User
Super User

To put together these collections by relating the Name from ColA with the lowest number ID in ColB, try:

Clear(OutputCol);
ForAll(ColA As aItem,
    With({aRecord: 
        First(
            SortByColumns(
                Filter(ColB, Name = aItem.Name),
                "ID",
                SortOrder.Ascending
            )
        )
    },
    Collect(OutputCol,
        {
            Name: aItem.Name,
            Title: aItem.Title,
            Link: aItem.Link,
            ID: aRecord.ID,
            ThumbnailURL: aRecord.Thumbnail.LargeURL
        }
    )
    )
);

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

hyonta
Frequent Visitor

Thank you for your kind answer.

Your idea completely works for me!!!!

Tanks a lot.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,039)