web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to concat a column...
Power Apps
Answered

How to concat a column row values into string (label to display all the values realted to a field value)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Team,

how to loop column values and extract them into a text(in one row) separated by coma, based on the city.

we have a table 

CityVillages
c1v1
c1v2
c1v3
c2v1
c2v2
c3v1

Expected values in the gallery like 

CityVill
c1v1,v2,v3
c2v1,v2,
c3v1
  

 

Please help me.
your reply is really appreciated with example. 
@v-bofeng-msft 

I have the same question (0)
  • Verified answer
    v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I've made a test for your reference:

     

    I assume there is a table


    ClearCollect(

        ComTest,

        {City:"c1",Vill:"v1"},

        {City:"c1",Vill:"v2"},

        {City:"c1 ",Vill:"v3"},

        {City:"c2",Vill:"v1"},

        {City:"c2",Vill:"v2"},

        {City:"c3",Vill:"v1"}

    )

     

    Add a Gallery and set it's items property to:

    GroupBy(ComTest,"City","New")

    vchengfenmsft_0-1667207365217.png

     

     

    Add a Label in Gallery and set it's Text property to:

    If(

        CountRows(ThisItem.New) > 1,

        Left(

            Concat(

                Filter(

                    ComTest,

                    City = ThisItem.City

                ),

                Vill & ", "

            ),

            Len(

                Concat(

                    Filter(

                        ComTest,

                        City = ThisItem.City

                    ),

                    Vill & ", "

                )

            ) - 2

        ),

        First(

            Filter(

                ComTest,

                City = ThisItem.City

            )

        ).Vill

    )

    vchengfenmsft_1-1667207365221.png

     

    Best Regards

    Cheng Feng

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard