cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tguihur
Helper I
Helper I

Compose and variables

Hi everyone,

 

I have a ms Forms which trigger my flow. In the Form I have an formNumber that start with a number following by letters. What I want to do is read that number and set a variable with an email. I have 50 emails.

For exemple.

 

If my formNumber start by 001 then variable is "asdadf@gmail.com

If my formNumber start by 002 then variable is asdfd2@hotmail.com

if my formNumber start with 003 then variable is asdfaei.casj@gmail.ca 

 

I dont want to use the conditional in PowerAutomate because is going to be so long.  So I wonder if I can use COMPOSE instead.

 

Anyone can help me with this please.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@tguihur 

If I understand you correctly, you have 50 separate email address that you may want to assign to the variable.  If that is the case, then I suggest storing the numbers from the form along with the related email addresses in a SharePoint list or Excel table.  Then, just lookup the email address.  You can then store that information in either a compose action or variable.  Then reference the variable or compose action as needed.

As a general rule, you should use a compose action unless you'll need to update the value.  Compose actions are much more efficient than variables.  

Let me know if you need additional help implementing the lookup or extracting the form number.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

4 REPLIES 4
ScottShearer
Super User
Super User

@tguihur 

If I understand you correctly, you have 50 separate email address that you may want to assign to the variable.  If that is the case, then I suggest storing the numbers from the form along with the related email addresses in a SharePoint list or Excel table.  Then, just lookup the email address.  You can then store that information in either a compose action or variable.  Then reference the variable or compose action as needed.

As a general rule, you should use a compose action unless you'll need to update the value.  Compose actions are much more efficient than variables.  

Let me know if you need additional help implementing the lookup or extracting the form number.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
VictorIvanidze
Community Champion
Community Champion

Hi @ScottShearer, could you please explain why you said "Compose actions are much more efficient than variables"?

What' the difference in terms of efficiency?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
ScottShearer
Super User
Super User

@VictorIvanidze 

My understanding is that variables need to be evaluated every time you reference them and Compose actions do not.  Therefore Compose actions run more quickly and theoretically will consume fewer API calls, etc..

Here is a link to a great video by @MattWeston365 that explains when and why to use each.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
tguihur
Helper I
Helper I

Thank you @ScottShearer for your answers and explanations. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,521)