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

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard