cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pinoq
Helper IV
Helper IV

create a variable

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

 
1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

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.

View solution in original post

6 REPLIES 6
sudharsan1985
Solution Sage
Solution Sage

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...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

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

sudharsan1985
Solution Sage
Solution Sage

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...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

 

Still cannot set, any thing I have set wrong?

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!

v-alzhan-msft
Community Support
Community Support

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.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,139)