cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyWork
Memorable Member
Memorable Member

Append character to each item in an array

Hi

 

If I have an array like this.

[
 "Somestring 1",
 "Something else 2",
 "Another string"
]

 

Can I in someway add a character in the beginning of each item in the array so it would look like this.
Adding character "["

[
 "[Somestring 1",
 "[Something else 2",
 "[Another string"
]
2 ACCEPTED SOLUTIONS

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @JimmyWork,

 

You could loop through each item of the array, add the [ character to a single item and append it to a Temp array. After the loop you can either use that Temp array value or update the original array.

 

Below is an example of such an approach.

 

"[@{item()}"

 

appendtoarray.png

View solution in original post

Paulie78
Super User
Super User

Here is another method which is faster and less complicated:

Concat Array.png

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @JimmyWork,

 

You could loop through each item of the array, add the [ character to a single item and append it to a Temp array. After the loop you can either use that Temp array value or update the original array.

 

Below is an example of such an approach.

 

"[@{item()}"

 

appendtoarray.png

@Expiscornovus Thank you so much for the quick help

Paulie78
Super User
Super User

Here is another method which is faster and less complicated:

Concat Array.png

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

Great solution, thank you @Paulie78 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,754)