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 Apps / Power Automate to crea...
Power Apps
Unanswered

Power Automate to create file and name it based on attachment contents and received date

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I'm trying to create my first flow, and I need it to automatically save email attachments to one drive. I've got that part figured out.

 

What I'm struggling with is if there's a way to pull a text from the email contents and use that as the name of the file. It's always the 6th "word" of the email body and it's a string of 4 numbers (could eventually be 5). I've tried html from text and compose. I've also tried find text position and substring. Can I get some help?

 

 

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,616 Super User 2025 Season 2 on at

    Hi @apasuf 

     

    First, add a action 'Initialize a variable' and name it 'FileName'.

    Add a 'Compose' action and then Split the email body into words:

     

    split(triggerBody()?['Body'], ' ') //This will give you an array of words.

     

     

    Now fill the variable by using the action 'Set the variable'. You can set the FileName variable to the 6th word. Array indices start from 0, so the 6th word will be at index 5.

     

    outputs('Compose')?[5]

     

     

    I also got some inspiration from https://powerusers.microsoft.com/t5/General-Power-Automate/Manipulate-filename-from-email-attachment/td-p/79663

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard