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

How join values in "Apply to Each" to a value after Apply to Each ?

I want to join all values in "Apply to Each" to a value after Apply to Each.

 

In my scenario:

In Apply to Each loop, create new values by Data Operations - Compose.

After the Apply to Each loop, create a value by join all values created in the loop.

This scenario can use to creating summary from some outputs from services.

 

1.png

 

 

 

 

Regards,

Yoshihiro Kawabata

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @fooshen

 

Yes. Compose:"@join(outputs('Compose2'), ',')" can build a result from results in Apply to Each.

 

Regards,

Yoshihiro Kawabata

View solution in original post

9 REPLIES 9
v-micsh-msft
Community Support
Community Support

Hi @yoshihirok,

 

Could you please explain a bit regarding "Join all values" here?

Have you checked the following article?

Could the HTML Tables, or the CSVs table helps in your scenario?

Build flows with HTML Tables, CSVs and other new features link OCR and image content detection

 

Do you mean to add them all together?

 

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-micsh-msft

 

"Join all values" make from some values to a value.

Yes, the blog "Build flows with HTML Tables, ..."

 

So, I want to do same with Apply-to-each.

Step 1. Get a array value.

Step 2. Create new value in  Apply-to-each from each array items.

Step 3. Create a new value from the values in Step 2 after Apply-to-each.

 

Example scenario:

Step 1. Get a array value by Excel - Get Rows.

Step 2. Create new value in Apply-to-each from each Excel Row item

  by Data Operations - Compose, concat first column and second column.

  Example: "Col1 Col2 / Row 1"

Step 3. Create a new value from the values in Step 2 after Apply-to-each with comma seperate

  Example: "Col1 Col2 / Row 1, Col1 Col2 / Row 2, Col1, Col2 / Row 3"

 

Regards,

Yoshihiro Kawabata

Hi @yoshihirok,

 

Thanks for the update.

 

I will try some tests, and share the result later.

 

Appreciate your patience.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-micsh-msft

 

Has this been solved yet?

 

Is it possible to get the summary of an apply to each loop?

 

I processed an array in the loop, then I want to send all the resulting values in one email. Not each result in 1 email.

I have a similar use case.

Get a list of items from a REST API call, apply to each to perform some string manipulation and then I want to construct a string representing all the processed strings.

 

1. Compose: "@createArray('a','b','c')

2. Apply to Each: Output from 1

2.1  Compose: "concat(item(), '-1')"

3. Join: Output from 2.1, ";".

 

Step 3 throws an error saying the output from 2.1 is null.

Any suggestions?

Hi @fooshen

 

Yes. Compose:"@join(outputs('Compose2'), ',')" can build a result from results in Apply to Each.

 

Regards,

Yoshihiro Kawabata

Anonymous
Not applicable

Hi @yoshihirok

 

I am using  the technique you describe but it is outputting the formula string and not the underlying variable e.g. ["@Join(outputs('First'),'')","@Join(outputs('First'),'')","@Join(outputs('First'),'')"]

 

My formula is @Join(outputs('First'),'')

 

Any ideas what I am doing wrong? Your help would be greatly appreciated.

Lexnnn
Helper II
Helper II

I needed to send email to users only once and not repeat their email address.

This is what I have done:

if(empty(item()?['Address']),'blank',item()?['Address'])

flow contains.JPGflow contains 2.JPG

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,904)