web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Auto Delete part of fi...
Power Automate
Unanswered

Auto Delete part of file name on sharepoint

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I am completely new to flows and it's logic so apologies if this is a stupid question...

 

I have jobs automatically uploading to a sharepoint via email, however they are saved with a random number in the file name, something which I am unable to change currently, so thought flows may be able to do it for me.

 

Sharepoint file name number.JPG

 

Is there a way in which I can move the .eml files to a separate folder whilst removing the "_number" from the file name?

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,858 Most Valuable Professional on at
    Re: Auto Delete part of file name on sharepoint

    Hi @Rob29 

     

    Are you planning to move the file to another SharePoint library folder or One Drive? Also to remove the _number is possible. There are different ways you could do this. One way is use expression split to split the filename using underscore. Then construct the filename.

     

    If you any futher help let me know.

     

    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

  • Verified answer
    v-alzhan-msft Profile Picture
    on at
    Re: Auto Delete part of file name on sharepoint

    Hi @Rob29 ,

     

    You could refer to screenshot below to create the flow to move .eml files to another folder:

    1.png

     

    If you also want to remove the "_number" from the file name of the .eml files, you could only create a new file with the new name and delete the original file, you could refer to screenshot below to create the flow:

    2.png

     

    The expression for the file name as below:

    concat(first(split(items('Apply_to_each')?['{FilenameWithExtension}'],'_')),'.eml')

     

    Please let me know if your problem could be solved.

     

    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.

  • Rob29 Profile Picture
    4 on at
    Re: Auto Delete part of file name on sharepoint

    Hi @abm 

     

    I would like to move the file to another folder within the same SharePoint.

     

    Are you able to share more specific instructions for the split function?

     

    Many thanks

  • Rob29 Profile Picture
    4 on at
    Re: Auto Delete part of file name on sharepoint

    Hi @v-alzhan-msft 

     

    Thanks for taking time to answer but I couldn't get the below to work. Just to be clear, should I use exactly what you showed e.g.

    concat(first(split(items('Apply_to_each')?['{FilenameWithExtension}'],'_')),'.eml')

    Or should I replace 'FilenameWithExtension' with the actual file name?

     

    In terms of getting it to work, is it an issue that the files are saved in the same top level folder (different sub folders)? Do I need to differentiate at a higher level?

    folder.JPG

     

    Many thanks

     

     

  • v-alzhan-msft Profile Picture
    on at
    Re: Auto Delete part of file name on sharepoint

    Hi @Rob29 ,

     

    Yes, please save the files in different library so the flow would easier to create and work, please take a try and let me knwo if your problem could be solved.

     

    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.

  • Community Power Platform Member Profile Picture
    on at
    Re: Auto Delete part of file name on sharepoint

    I have this file name:

     

    export_company_tasks_overview_20211015073353

     

    How can I make it: 

     

    export_company_tasks_overview

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard