Showing results for 
Search instead for 
Did you mean: 
New Member

Changing file name and replacing the file with the same name in OneDrive

I need to be able to change file name from an email attachment.

The attachment is coming in like this: CHull APs due 30 days-06052020-18.xlsx. 

I need to save attachment as: CHull APs due 30 days.xlsx (delete everything pass the -) for every email attachment.

In the OneDrive Business folder, a file with the same name already exists. So, I need the new one to override the existing one.


I can't seem to find a good example to assist me with this situation.


Please help.


Eva Garcia


Re: Changing file name and replacing the file with the same name in OneDrive



this might be a bit lengthy process but will help you with resolution.


Consider we have a string  CHull APs due 30 days-06052020-18.xlsx and we want the resultant string to be  CHull APs due 30 days-06052020-18.xlsx


To achieve this you can make use of split function.


when you do Split(string,separator('-')) it will split the string based on the separator value which is '-' and will make it into three parts


Chull APs due 30 days 06052020 18 now this is in format of array where in we can use indexes to refer the value that we like.


Now if we add a compose action to the flow and how outputs(split function executed previously)[0] this will show the text Chull APs due 30 days.


You can do the same to extract the file extension, and do a contact to join both the values.


If this information helps you with resolution, please consider giving a thumbs up and mark the solution as resolved.

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (6,484)