Skip to main content
Community site session details

Community site session details

Session Id : MrETwtjYkKLNqNO7xtRl5h
Power Automate - Building Flows
Answered

Join Array of email addresses - error

Like (0) ShareShare
ReportReport
Posted on 22 Apr 2024 12:57:00 by 32

Hello,

 

I have a relatively simple flow that is triggered upon submission of an MS form. An array variable called 'emailList' is initialised. Depending upon the answers submitted in the form, different email addresses are appended to the 'emailList' variable. I have a compose step that then joins the elements of the array into a string, separated with '; '. The output of this compose set is used in the 'To' field of the "Send an email (V2)" action.

 

Until recently this flow was working fine. I made a change to the MS Form on one of the questions (from being able to select multiple answers to only one) and but now I get an error at the email action stating "join  expects the first parameter to be an array. Provided value is of type 'String'.

 

I cannot work it out, the variable is definitely an array, and each step where email addresses are added are "append to array".

 

 

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 24 Apr 2024 at 16:12:20
    Re: Join Array of email addresses - error

    I am glad that your problem is resolved 😃

  • Verified answer
    RedSnow_94 Profile Picture
    32 on 24 Apr 2024 at 15:56:50
    Re: Join Array of email addresses - error

    In case anyone finds the same error, the thing that was wrong was my brain....I had another "join" function within the body of the email action that took the answers to what was the multiple choice question in the Form. Once I had changed the form so a user could only pick one option, this was no longer passed as an array.

     

    I erroneously thought the error message was relating to the join function in the "To" field.

     

    Manish, sorry to have wasted your time!

  • RedSnow_94 Profile Picture
    32 on 22 Apr 2024 at 15:27:36
    Re: Join Array of email addresses - error

    Thanks Manish, tried that, still the same error....

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 22 Apr 2024 at 15:25:32
    Re: Join Array of email addresses - error

    Pls try the below expression. I have removed empty space after colon:

    join(variables('emailList'), ';')

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • RedSnow_94 Profile Picture
    32 on 22 Apr 2024 at 14:22:46
    Re: Join Array of email addresses - error

    Yes, the input for "Compose 1" is: 

    join(variables('emailList'), '; ')
     
    The input for the "To" field in the email step is the output from "Compose 1". I have also tried setting the "To" field directly using the above formula but results in the same error....
  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 22 Apr 2024 at 13:57:19
    Re: Join Array of email addresses - error

    Hi @RedSnow_94 

     

    Is the compose showing the result of join() function that has been used in "To" parameter of send an email action?

     

     

  • RedSnow_94 Profile Picture
    32 on 22 Apr 2024 at 13:34:23
    Re: Join Array of email addresses - error

    Hi Manish,

     

    I already had a compose step to check this, it looks ok to me but appreciate if you can have a look:

     

    6.png

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 22 Apr 2024 at 13:04:23
    Re: Join Array of email addresses - error

    Hi @RedSnow_94 

     

    Pls add a compose action just before "Send an email" action to verify the values store in 'emailList' variable.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started