web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Answered

create a variable

(0) ShareShare
ReportReport
Posted on by 102

Hey , I would like to know that how can I create a variable in order to store emails in a variable?

I have created a flow when trigger by when an item is created, send an email to assign to and CC email.

which CC email is a multiple selection of groups of email. It cause in some case if 2 persons selected in cc, assign to will receive 2 identical emails. Thus,I would like to to store all cc emails in a variable. How can I set it up?Because I cannot choose the variable in dynamic.

Set CC Email varaible.PNG

 
Categories:
I have the same question (0)
  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @Pinoq 

    Try to use the array variables and append the values to the array variable and finally use the join condition to join all the values in an array with ';' separated and then the final output to the mail CC. Try to use the below expression for joining the arrary variable.

    join(variables('ArrayVariableName'),';')

     

    Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue

    -Sudharsan K...

  • Pinoq Profile Picture
    102 on at

    Sorry, I am new in Power Automate. Can you explain more detail?

  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @Pinoq 

    Based on your screenshot below please follow the below steps

    1. In your 'Initialize Variable' section, create a variable of type 'Array' and in the value just give '[]'

    2. In your 'Apply to each 2' action, remove the 'Set Variable' action use 'Append to array variable' and then use the above declared variable.

    3. In the email action use the dynamic expression 'join(variables('array variable name'),';')'.

     

    Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue

    -Sudharsan K...

  • Pinoq Profile Picture
    102 on at
     

    Still cannot set, any thing I have set wrong?

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Pinoq 

     

    You can follow the suggestion provided in the thread here. 

     

    https://powerusers.microsoft.com/t5/Building-Flows/Array-Setting/m-p/493581#M61166

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Verified answer
    v-alzhan-msft Profile Picture
    on at

    Hi @Pinoq ,

     

    If the CC column and the assign to column are person type column, please refer to screenshot below to create the flow:

    1.png

     

    Best regards,

    Alice       

     

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard