cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
demondan
Helper I
Helper I

Append to Array

Hi

I am trying to add a string to an array.  And it works however the result is not what I was hoping for. 

 

So the string is:

{"Title": "Edward"}

and the array is:

[ {"Title": "Lyn"},{"Title": "Andy"}, {"Title": "James"}, {"Title": "Paul"}

 

the result:

[
  {
"Title": "Lyn"
  },
  {
    "Title": "Andy"
  },
  {
    "Title": "James"
  },
  {
    "Title": "Paul"
  },
  "{\"Title\": \"Edward\"}"
]
 
How can I add it so that it doesn't add in the extra double quotes and the back slashes?
 
Thanks
Dan
1 ACCEPTED SOLUTION

Accepted Solutions
Jcook
Super User III
Super User III

Hello,

This blog goes deep into getting rid of special characters from an output.

Here is the link to the blog post:
https://www.alanps1.io/power-platform/flow/flow-stripping-unwanted-characters-or-special-characters-...

--Josh

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

5 REPLIES 5
Jcook
Super User III
Super User III

Hello,

This blog goes deep into getting rid of special characters from an output.

Here is the link to the blog post:
https://www.alanps1.io/power-platform/flow/flow-stripping-unwanted-characters-or-special-characters-...

--Josh

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

Hi

So are you saying, add it as I've done and then remove the additional quotes and backslashes that are not required?  I was thinking I am not appending the string correctly - because its adding the string to the end of the array but what I want is to add the string as an item of the array?

 

Thanks

Dan

Could you post a picture of your flow.
Thanks

--Josh

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





This website wont let me add a screenshot keeps telling me invalid html was found.

 

Basically I have 4 steps.

1 - initialise a string variable (aUser) and its value is {"Title": "Edward"}

2 - initialise an array variable (someUsers) and its value is 

[ {"Title": "Lyn"},{"Title": "Andy"}, {"Title": "James"}, {"Title": "Paul"}

3 - Append to array variable - where name is someUsers and value is aUser

4 - Compose someUsers

 

I guess it works it in the sense that it does append the string to the array, but that's not what I want, I want to add the string as a new item/element to the array?  I hope that makes sense!

Hi

I managed to work around what I was trying to do.  I dont really need the Title part within the array I was trying to use so I used your advice to strip away the multiple instances of Title and left myself with an array that looks like [Lyn, Andy, James, Paul] and now I can add items into it!

 

cheers

Dan 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (939)