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 / Merge a table with 1 r...
Power Apps
Answered

Merge a table with 1 row every 2nd row

(0) ShareShare
ReportReport
Posted on by 30

I have a collection of data coming from an email that works like this:

 

"TIMESTAMP","Content","TIMESTAMP1","Content1","TIMESTAMP2","Content2","TIMESTAMP3","Content3"

 

 

I have this code that divides it where I can place it in a sub-gallery (inside the first one) to display in order with only the last 4:

 

LastN(Split(ThisItem.notes,","),4)

 

Result: 

TIMESTAMP3
Content3
TIMESTAMP4
Content4

 

I would like to get it to combine each TimeStamp and Content together resulting in:

TIMESTAMP3: Content3
TIMESTAMP4: Content4

 

I am stumped as that what would be the best way to go about it.

Categories:
  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jessetechno 

    Please try the following,

    ClearCollect(result,
     With({varSplitStrings: Split("TIMESTAMP1,Content1,TIMESTAMP2,Content2,TIMESTAMP3,Content3,TIMESTAMP4,Content4",",")},
     LastN(RemoveIf(ForAll(Sequence(CountRows(varSplitStrings)),
     If(Mod(ThisRecord.Value,2)<>0, Index(varSplitStrings, ThisRecord.Value).Value & ": " & Index(varSplitStrings, ThisRecord.Value+1).Value )
     ), ThisRecord.Value=Blank()), 2)
     )
    )

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Jessetechno Profile Picture
    30 on at

    I mean it kind of work, but it cuts out the first bit of data.  I am gonna play with it to see if I can get that beginning data working.  But its pretty good!

    Screenshot (12).png

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jessetechno what do you mean by - it cuts the first bit of data. It does exactly what you wanted. 

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Jessetechno Profile Picture
    30 on at

    It does combine 

     

    "TIMESTAMP3,Content3,TIMESTAMP4,Content4"

     

    but it got rid of:

    "TIMESTAMP1,Content1,TIMESTAMP2,Content2"

    I can see how it looks like I wanted this data out but that was a miscommunication on my part.  I need all the data.

     

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Jessetechno 

    Please try the following,

    ClearCollect(result,
     With({varSplitStrings: Split("TIMESTAMP1,Content1,TIMESTAMP2,Content2,TIMESTAMP3,Content3,TIMESTAMP4,Content4",",")},
     RemoveIf(ForAll(Sequence(CountRows(varSplitStrings)),
     If(Mod(ThisRecord.Value,2)<>0, Index(varSplitStrings, ThisRecord.Value).Value & ": " & Index(varSplitStrings, ThisRecord.Value+1).Value)
     ), ThisRecord.Value=Blank())
     )
    )

    Please remember to give a 👍 and accept my solution as it will help others in the future.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard