Skip to main content

Notifications

Power Automate - Building Flows
Answered

Join Array of email addresses - error

(0) ShareShare
ReportReport
Posted on by 30

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
    ManishSolanki 15,075 on at
    Re: Join Array of email addresses - error

    I am glad that your problem is resolved 😃

  • Verified answer
    RedSnow_94 Profile Picture
    RedSnow_94 30 on at
    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
    RedSnow_94 30 on at
    Re: Join Array of email addresses - error

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

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    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
    RedSnow_94 30 on at
    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
    ManishSolanki 15,075 on at
    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
    RedSnow_94 30 on at
    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
    ManishSolanki 15,075 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard