cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CP0822
Helper I
Helper I

Collections and concat combination

Hi guys,

 

I have a sort of data in a sharepoint list and I would like to do something link this in a collection:

 

Sharepoint list

Text 1

Text 2

Text 3

Text 4

Text 5

Text 6

Text 7

Text 8

 

Collection

Text 1, Text 2, Text 3, Text 4

Text 5, Text 6, Text 7, Text 8

 

Any ideas?

7 REPLIES 7
BCBuizer
Super User
Super User

Hi @CP0822 ,

 

The Concat() function will do that foryou:

Concat('SharePoint List', Title & ", " )

 

 https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concatenate



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
CP0822
Helper I
Helper I

I think I didn't make myself clear. @BCBuizer 

 

The first 4 items of the sharepoint list should be in the first row of the collection. Then from the 5th to the 8th item should be in second row of the collection.

 

I appreciate any idea.

EdViegas
Super User
Super User

what if...

 

Clear(ColGoal);
Clear(ColCount);
ForAll(
    'SPO List' As Item,
    Collect(
        ColCount,
        {val: 'SPO List'.Title}
    );
    If(
        Mod(
            CountRows(ColCount),
            4
        ) = 0,
        Collect(
            ColGoal,
            Concat(
                LastN(
                    ColCount,
                    4
                ),
                val & ","
            )
        )
    )
)

 

Hi,

 

Not sure why but I'm getting this error, just modified the SP List name and add a filter in the SP List.

 

CP0822_1-1648511738046.png

 

 

 

 

@EdViegas 

 

I was looking into ColCount Collection and this is happening.

 

CP0822_2-1648512263178.png

 

EdViegas
Super User
Super User

That's because in your case the value of val is a table (the return of Filter) and not a text field. Try setting val as a LookUp(..).field instead 

Hi,

 

I tried to access the nested table and this is my final result, this SP list have 36 different items but in each row of the collection I'm getting the same value. This is my code

 

CP0822_0-1648577363535.png

 

Clear(ColGoal);
Clear(ColCount);
Clear(Test);
ForAll(
Filter(
Data_bultos,
Traveler = traveler_s.Text
) As Item,
Collect(
ColCount,
{
val: Filter(
Data_bultos,
Traveler = traveler_s.Text
).Title
}
);
Collect(
Test,
First(ColCount).val
);
If(
Mod(
CountRows(Test),
4
) = 0,
Collect(
ColGoal,
Concat(
LastN(
Test,
4
),
Title & ","
)
)
)
)

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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