Help Adding Version Number to Excel File Name When Template Already Exists

Hi,

I’m trying to build a scenario in Make where an Excel file is created from a template. If the file name already exists in the target OneDrive folder, I want Make to automatically append a version number such as:

  • filename.xlsx

  • filename_v2.xlsx

  • filename_v3.xlsx

  • etc.

I do not want make to overwrites the file that is already there.

Can you please provide guidance or an example for how to implement this version-incrementing logic inside Make (using search modules, iterators, or functions)?

Thank you!

Hey there,

you can try searching for files with similar name first. using the contains() function or filter for example.

If it doesn’t exist - create a new one.

If some exist, check if there is _v# in the name.

If there isn’t - create a file with _v2 in the name.

If there are, do something like _v#+1 to increment it.

Thanks. So right now I copy the template (Copy a File). it is assigned a new name. Then progress to Get a file. Perhaps after that I add something to change the file name? Thanks.

You can try using the OneDrive “Search Files/Folders” module —

Searches for the files or the folders.

For more information about the Search Files/Folders module and OneDrive app, see the corresponding Integrations page and the Help Centre documentation.

Hope this helps! If you are still having trouble, please provide more details.

@samliew

Thank you. When I do the search, how do find out what version is there? V1, V2, V3. Also, how do I rev it rather than overwrite the file name. Suggestions welcome. Thank you.

David