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 Platform Community / Forums / Power Automate / Birthday Email to Incl...
Power Automate
Unanswered

Birthday Email to Include Random Images

(0) ShareShare
ReportReport
Posted on by 14

We have created a flow to send birthday emails to employees, its working as expected fetching the data from sharpeoint list. however the HR team wanted random images to be included in the email, in the email body i couldn't see an option to include picking of random images from may be a pool of 5 images each time when it send the email.  

 

i know that we can use JavaScript in html to achieve this, however with msflow JS wont work is what i know. any way that i could achieve this , appreciate the help

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @sandeepcrush,

     

    if you are confident attaching files to an email, why don't you use the function rand(1,5) to generate a random number from 1 to 5 and using that answer look up an image with column image number 1 to 5 in a sharepoint list?  Or have a condition statement for image 1 to 5 based on the random number.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • sandeepcrush Profile Picture
    14 on at

    Thanks @DamoBird365 , let me try this , do you have any examples of such scenarios?

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hey @sandeepcrush 

     

    I've tried it myself.  You could use a list but thought of an even easier way.  You can simply save the images to your document library as 1,2,3,4,5.jpg etc.

     

    DamoBird365_0-1613747993852.png

     

    Then use rand(1,5) in a compose and use the compose string in the ile identifier.

     

    DamoBird365_1-1613748291009.png

     

    For the file identifier, I had to convert / and spaces into unicode hex.

     

    For example 

    %252fShared%2bDocuments%252fGeneral%252f3.jpg

    OR

    %252fShared%2bDocuments%252fGeneral%252f@{outputs('Compose')}.jpg

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • ajdhingr Profile Picture
    Microsoft Employee on at

    @DamoBird365 Thanks for sharing. @sandeepcrush were you able to resolve your issue ?

  • pradeep_kumar Profile Picture
    42 on at

    Hi

     

    i want to insert image in email body but match numbers of work years and image number and embedded image in email body such as 

     

    teammate years number 1=1(image name) that insert in email body

  • aakkuummaarr Profile Picture
    46 on at

    Hi @DamoBird365 ,

     

    What is the Concat you have used in Attachment Name please?

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard