cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Thomas
Level 8

Join values from Excel Table column (without foreach)

I´d like to join the recipients from an Excel Sheet and add them as email receiver.

 

When I select column "Recipients" from my Excel table, I get a "you cannot use a foreach function in another foreach". That´s right, but it also prevents me from putting a join() around it. And I´m not able to see the code behind the "Recipients".

 

After selecting the Expression-tab, I only see "List of Elements" and "value". "Recipients" disappeard.

I tried both in different ways, but it always gave me null as result.

 

join(body('Recipients_retrieve')?['Recipients'], ';')

join(body('Recipients_retrieve')?['value']?['Recipients'], ';'

Using a foreach creates an item() out of body('Recipients_retrieve')?['Recipients'].

Then it is possible to call item()?['Recipients']. But that is not what I want. I´d like to have all Recipients semicolon seperated at once.

 

Got it on german, only. "Empfänger" means "Recipients".

Flow Recipient.png

 

Background:

Each entry in a different table contains a birthdate from my collegues. It checks if it is today and sends me an email with him/her. Now I wanted to extend the Excel file with multiple recipients.

 

Is it somhow possible to join a specific column from a table? Or am I just blind 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
Thomas
Level 8

Re: Join values from Excel Table column (without foreach)

I finally found a solution, which fulfilled my needs.

But it is a bit tricky:

It is not allowed to assign a variables value to the same variable ( += ). Due to that, it is not possible to join the recipients into a single string, from within a foreach-loop.

Exept, you are using a Composition and a Variable:

 

Flow Composition.png

 

Now I get a text:

Today´s birthdays:
Peter Parker (17.08.1983)
Bruce Wayne (17.08.1964)

A little bit more complicated then needed, but it works 🙂

View solution in original post

1 REPLY 1
Thomas
Level 8

Re: Join values from Excel Table column (without foreach)

I finally found a solution, which fulfilled my needs.

But it is a bit tricky:

It is not allowed to assign a variables value to the same variable ( += ). Due to that, it is not possible to join the recipients into a single string, from within a foreach-loop.

Exept, you are using a Composition and a Variable:

 

Flow Composition.png

 

Now I get a text:

Today´s birthdays:
Peter Parker (17.08.1983)
Bruce Wayne (17.08.1964)

A little bit more complicated then needed, but it works 🙂

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 101 members 5,481 guests
Please welcome our newest community members: