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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (1,820)