cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ppl
Post Patron
Post Patron

Concat last element of the array with previous

[
     {
          "User1": "john@microsoft.com",
          "User2": "bill@microsoft.com"
     },
     {
          "User1": "kate@microsoft.com",
          "User2": "bob@microsoft.com"
     },
     {
          "User1": "sarah@microsoft.com",
     }
]

I need to add last element of the array and write them into string

@Paulie78 helps me with case of 3 elements with formula: concat(outputs('Array')[1], ';', outputs('Array')[2])

Result:

1st group  john@microsoft.com;bill@microsoft.com

2nd group kate@microsoft.com;bob@microsoft.com;sarah@microsoft.com

 

 

But if there is a 2 elements 

[
     {
          "User1": "kate@microsoft.com",
          "User2": "bob@microsoft.com"
     },
     {
          "User1": "sarah@microsoft.com",
     }
]

Or four:

[
     {
          "User1": "john@microsoft.com",
          "User2": "bill@microsoft.com"
     },
     {
          "User1": "kate@microsoft.com",
          "User2": "bob@microsoft.com"
     },
     {
          "User1": "sarah@microsoft.com",
"User2": "george@microsoft.com", },
{
"User1": julia@microsoft.com",
} ]

formula is not working.

What condition I need to write to make this formula works for 3,4,5,6.... elements?

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,540)