cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AFWS
Regular Visitor

Apply to Each array problem

I'm pretty sure I'm doing something basic incorrectly. Here's the problem

I have a flow which brings in some plain text from a file and splits it into an array. It then builds a string from the array and attaches that to an email as a file. I've kept it simple right now, there'll be more trickery later, but I can't get this simple version to output the array values correctly using 'apply to each'.

 

 

image.pngSplit the content on SOL

 

 

 
 

image.pngOutput two ways, one is the text as assembled by apply to each, which consists of three lines exactly the same. The first line is array[0]

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @AFWS 

 

In your Append to string variable action, what is your expression? In my opinion it should just be "item()".

Kind regards, John

View solution in original post

3 REPLIES 3
AFWS
Regular Visitor

The crappy editor dropped two images

Shows apply to each pulling in the entire array as each line, rather than each item. Still knows it's three so it is reading the array as three lines. Note also it's got the array delimiters pulled in.

image.pngThe whole flowThe whole flow

Hello @AFWS 

 

In your Append to string variable action, what is your expression? In my opinion it should just be "item()".

Kind regards, John

View solution in original post

Yes, bang on. Where is it written!?

I had assumed that's what the apply to each was looking for, each item in the array, not each array? It's a bit counter intuitive that it iterates the array not the items. And even then, why would it repeat for each item!

 

Thanks John.

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.

Users online (2,553)