cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Randomizing email design

Hi all,

 

Is there a way to randomize emails sent via Power Automate Outlook connection? Let's say, I have three different email designs and I want to send a random one when the flow is triggered.

 

Any help would be appreciated. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: Randomizing email design

Hi,

 

if I understood you right, you can achieve this as follows:

 

rand.png

 

Create a switch with options 1, 2 and 3 and set the On expression to rand(1, 3). It will generate a random value between 1 and 3 and will then send email 1, 2 or 3.

 

Max

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Re: Randomizing email design

Hi!

Yes, I believe so. there is a WDL function called rand(), so assuming you have 3 email body designs you can just store them in three 'Compose' action blocks,let's name them 'Compose 1', 'Compose 2', 'Compose 3'.

Then add an 'Initialize variable' action block, type string let's call it 'TargetBody', then add a 'Switch' action block, assign as its input the following expression:

rand(1,4)

So you just need to define 3 branches for the Switch (values 1, 2 and DEfault for 3).

Inside branch 1, add a 'SEt variable' action block, name 'TargetBody', assign as its value the following expression:

outputs('Compose_1')

Inside branch 2, add a 'SEt variable' action block, name 'TargetBody', assign as its value the following expression:

 

outputs('Compose_2')

Inside branch Default, add a 'SEt variable' action block, name 'TargetBody', assign as its value the following expression:

 

outputs('Compose_3')

Now, out of your Switch, add a 'SEnd an email' action block, assign as its value variable 'TargetBody'

 

If you are unfamiliar with WDL expressions, please follow these steps to add them:

https://youtu.be/LPZ-WZoWwp4

 

Please let us know your progress, if you find any issue implementing this approach do not hesitate to share a screenshot from your flow design and the problem encountered

Hope this helps

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Resolver I
Resolver I

Re: Randomizing email design

Hi,

 

if I understood you right, you can achieve this as follows:

 

rand.png

 

Create a switch with options 1, 2 and 3 and set the On expression to rand(1, 3). It will generate a random value between 1 and 3 and will then send email 1, 2 or 3.

 

Max

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: Randomizing email design

@Kikoger

That's the idea, but... if you add the 'Initialize variable', 'Set variable' stuff you can test this approach 3-4 times just before adding 'Send an email', so you will not disturb anybody else while testing.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (7,513)