Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Combine multiple rows in SharePoint list into a row

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am wondering if anyone has a solution for this issue that I am facing.

I have a SharePoint list with multi rows with the same value in A, B, C column and different time value in a time range.

I want to combine multiple rows into a row, looks like below:

 

kinghnvn_0-1638084428381.png

Does anyone here know if there is a way to do this?

Thanks

 

 

  • WarrenBelz Profile Picture
    146,658 Most Valuable Professional on at
    Re: Combine multiple rows in SharePoint list into a row

    @kinghnvn ,

    We are going in circles - that is not the code I posted that you are saying has errors.

  • kinghnvn Profile Picture
    on at
    Re: Combine multiple rows in SharePoint list into a row

    I meant the entire Items code of your gallery -> please find my Items code of Gallery below.

    Thank you very much for your kindly help.

     

    SortByColumns(
    Filter(
    'Desk Reservations',
    'Reserved By'.Email = currentUser.Email && 'Check Out From Number' >= Value(
    Text(
    Now(),
    "yyyymmddhhmm"
    )
    )
    ),
    "CheckOutFromNumber",
    Ascending
    )

     

    kinghnvn_0-1638198625277.png

     

  • WarrenBelz Profile Picture
    146,658 Most Valuable Professional on at
    Re: Combine multiple rows in SharePoint list into a row

    @kinghnvn ,

    I meant the entire Items code of your gallery - I cannot tell much from two lines at the top and that simply there are errors in them. Due to time zone, I am going to offline now. Can you please read back through this post and in particular the code I supplied - it is going to be fairly close to correct - just make sure your references are valid.

  • kinghnvn Profile Picture
    on at
    Re: Combine multiple rows in SharePoint list into a row

    @WarrenBelz 

     

     can you please supply the code in text and in the picture show the entire code -> sure, please find below code for your reference.

     

    Upper(Text(DateTimeValue(ThisItem.'Check Out From Text'),"[$-en-US]mmm"))

    kinghnvn_0-1638181847260.png

    Upper(Text(DateTimeValue(ThisItem.'Check Out To Text'),"[$-en-US]mmm"))

    kinghnvn_1-1638181905329.png

    Upper(Text(DateTimeValue(ThisItem.'Check Out From Text'),"[$-en-US]dd"))

    kinghnvn_2-1638181967894.png

     

    Upper(Text(DateTimeValue(ThisItem.'Check Out To Text'),"[$-en-US]dd"))

    kinghnvn_3-1638182028521.png

    Text(DateTimeValue(ThisItem.'Check Out From Text'), DateTimeFormat.ShortTime) & " to " & Text(DateTimeValue(ThisItem.'Check Out To Text'), DateTimeFormat.ShortTime)

    kinghnvn_4-1638182104540.png

    ThisItem.'Desk Text'

    kinghnvn_5-1638182316559.png

     

  • WarrenBelz Profile Picture
    146,658 Most Valuable Professional on at
    Re: Combine multiple rows in SharePoint list into a row

    @kinghnvn ,

    The bit you posted does not help me - can you please supply the code in text and in the picture show the entire code. Also please note this needs some investigation on your end into the validity of the values referred to - I cannot see your data and can only rely on what you post. My code is more guidance on the structure required - it is up to you to apply your values to it.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • kinghnvn Profile Picture
    on at
    Re: Combine multiple rows in SharePoint list into a row

    Sorry, I didn't explain that very well. Thank you for your patience.

     

    Below is the error

    The function "GroupBy" has some invalid arguments.
    The function 'AddColumns' has some invalid arguments.

    kinghnvn_0-1638173009958.png

  • WarrenBelz Profile Picture
    146,658 Most Valuable Professional on at
    Re: Combine multiple rows in SharePoint list into a row

    @kinghnvn ,

    I am getting a bit lost here - your post question was how to group records that match on four fields - the GroupBy() function will do that (can we please stick on this subject). What code are you using with the GroupBy() - in Text please and why is it not working (do you get an error - if so what  - or do you get the wrong results?)

  • kinghnvn Profile Picture
    on at
    Re: Combine multiple rows in SharePoint list into a row

    Noted with thanks. I tried your group by code in gallery but it's still not working. I guess because I have many titles in gallery. Should I set a flow to edit value in SharePoint list? Please advise.

     

    kinghnvn_0-1638170865237.png

    kinghnvn_1-1638170875420.png

     

    kinghnvn_2-1638170946516.png

     

    kinghnvn_3-1638171010095.png

  • WarrenBelz Profile Picture
    146,658 Most Valuable Professional on at
    Re: Combine multiple rows in SharePoint list into a row

    @kinghnvn ,

    I meant the code I posted as the Items of the gallery

    GroupBy(
     YourListName,
     "Name",
     "StartDate",
     "EndDate",
     "StartTime",
     "EndTime",
     "Data"
    )

    you probably need something like this

    SortByColumns(
     AddColumns(
     GroupBy(
     Filter(
     'Desk Reservations',
     'Reserved By'.Email = currentUser.Email && 
     'Check Out From Number' >= Value(Text(Now(),"yyyymmddhhmm"))
     ),
     "Name",
     "StartDate",
     "EndDate",
     "StartTime",
     "EndTime",
     "Data"
     ),
     "SortNo",
     First(Data).'Check Out From Number'
     ),
     "SortNo",
     Ascending
    )

    but again I must ask (as per your previous post) why are you converting dates to numbers (this was necessary some time ago before dates were Delegable, so maybe you have an old template)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • kinghnvn Profile Picture
    on at
    Re: Combine multiple rows in SharePoint list into a row

    @WarrenBelz 

    I put the code in the Items of the gallery 

    kinghnvn_0-1638166057453.png

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard