cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bochie
Helper II
Helper II

Help with Collection and HTMLText Input

Hi All,

I'm trying to compose an email body via the HTMLText control. In one of my cells, I would like to show the values from several datasources with Concat function. From the images below, how can I put into a collection items from DataSource2 that have matching names in DataSource1. From the resulting collection, I can then use the Concat function for populating my table cell. Am I using the correct logic for it? Thanks for any help!

colImage.png

colCell.png

1 ACCEPTED SOLUTION

Accepted Solutions
Eelman
Super User
Super User

@Bochie 

This code will create your collection 

Clear(collection);

ForAll(
    DataSource1 As DS1,
    ForAll( RenameColumns(DataSource2,"ID","ID_DS2") As DS2,
        If( DS1.Name = DS2.Name,
            Collect(collection,
                {
                    Name: DS2.Name,
                    ID: DS2.ID_DS2
                }
            )
        )
    )
)



View solution in original post

4 REPLIES 4
Eelman
Super User
Super User

@Bochie 

This code will create your collection 

Clear(collection);

ForAll(
    DataSource1 As DS1,
    ForAll( RenameColumns(DataSource2,"ID","ID_DS2") As DS2,
        If( DS1.Name = DS2.Name,
            Collect(collection,
                {
                    Name: DS2.Name,
                    ID: DS2.ID_DS2
                }
            )
        )
    )
)



View solution in original post

yashag2255
Dual Super User II
Dual Super User II

@Bochie 

 

Can you try to use the expression below:

 

ForAll(Filter(DataSource2, Name in DataSource1.Name), Collect(CollectionName, {Name: ThisRecord.Name, ID = ThisRecord.ID}))

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

@Eelman Thank you! I used your formula on my screen's OnVisible event and then I used a nested Concat while renaming the "parent" concat table columns to reference them in my child table. It worked! Non-dev here and been working on PowerApps for a month now, this thing is amazing as well as this community. Thank you!

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

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

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (44,865)