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".
I am glad that your problem is resolved 😃
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!
Thanks Manish, tried that, still the same 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.
Yes, the input for "Compose 1" is:
Hi @RedSnow_94
Is the compose showing the result of join() function that has been used in "To" parameter of send an email action?
Hi Manish,
I already had a compose step to check this, it looks ok to me but appreciate if you can have a look:
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.